jordanbk
09-16-2010, 01:13 PM
Hi folks,
How does one trap run-time exception errors which occur as a result of RowSource settings (which were set using the Properties window in Design View)?
I'm working with a large codebase of VBA written in Access 2003. In over 100 instances, the developer used RowSource to enter a SELECT query, from the Properties window (not at runtime), with RowSourceType = "Table/Query". I'm tasked with adding error handling throughout the code, but I can't find a way to trap errors which might happen when the RowSource query executes.
I've considered moving the query from the Properties window into the Form Load event, setting the control's RowSource property there at runtime. But I still can't think of a way to trap it using ON ERROR, because when the RowSource query executes, VBA/Access is outside of any of my procs/functions, thus ON ERROR doesn't apply.
If I can't trap the errors, Access will show a message box and my error logging/handling code won't run. (For example, I'm expecting some possible timeout errors on these SELECT queries.)
Any thoughts?
Thanks,
Jordan
How does one trap run-time exception errors which occur as a result of RowSource settings (which were set using the Properties window in Design View)?
I'm working with a large codebase of VBA written in Access 2003. In over 100 instances, the developer used RowSource to enter a SELECT query, from the Properties window (not at runtime), with RowSourceType = "Table/Query". I'm tasked with adding error handling throughout the code, but I can't find a way to trap errors which might happen when the RowSource query executes.
I've considered moving the query from the Properties window into the Form Load event, setting the control's RowSource property there at runtime. But I still can't think of a way to trap it using ON ERROR, because when the RowSource query executes, VBA/Access is outside of any of my procs/functions, thus ON ERROR doesn't apply.
If I can't trap the errors, Access will show a message box and my error logging/handling code won't run. (For example, I'm expecting some possible timeout errors on these SELECT queries.)
Any thoughts?
Thanks,
Jordan