Hi Sally
I think were going to need some more information. "Bad runtime function reference at line..." would normally point to where the error occurs, but you say that this is not the case?
Are you sure that the system error event is reporting the correct information? If it is then I would suggest taking another look at the reference it is referring to and ask does the object involved exists. What state is the application in when the error occurs and what happened immediately beforehand. Was the user closing a window or something else?
Anyway if you could share the exact error and the code it is referring to I would be happy to put my mind to the problem.
Cheers
David