LeLeBrown
asked on
Access 2010 step in macro fails
I have a macro in Access 2010 with several queries. One query has a ODBC connection. when the connection fails for any reason, I want to do something else. Is there a way to detect a failure of a specific query in a macro and do something if it fails or would I have to create a stand alone macro and see if the macro itself fails?
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
OK, so if my post helped you in some way, then I am happy
;-)
;-)
ASKER
Thanks for the response. I ended up doing something in VBA like your example.
To explain further:
I have one query that depends on a ODBC connection that creates a Access local table. If the connection is not available (which seems to happen with some frequency), I don't want my code to stop(because it runs on its own - set up as a task in task manager). I created a macro to run this query and called it from VBA. If it fails (I don't care why), I run another macro that makes a table based on the old data copied from the previous day(that doesn't rely on the odbc conn).