Results 1 to 4 of 4

Access 2010 Macro Help

  1. #1
    RayMilhon is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    717

    Access 2010 Macro Help

    I have an MS Access 2010 Database that is populated nightly from SQL Server using Windows Scheduler and the autoexec Macro. The macro should run populate 2 tables and shut Access down. The problem is that if SQL Server is unavailable for any reason the Macro errors and displays the error message and waits for a user to click on the halt button. I want it to automatically halt and exit the database without user intervention. Is this possible?

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,558
    Do you already have the SetWarnings action in your Macro set to 'No'?

  3. #3
    RayMilhon is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    717
    Yep. The problem is that the SQL Server DB is a Reporting DB copied from a Production DB on a nightly basis. Occassionaly the copy fails and the Reporting DB is unavailable. Since the Access DB is automated to run prior to anyone coming in The Link to SQL Server may be down when the macro runs. The macro steps are in order:

    1. Set Warnings off
    2. Copy tbl_Auths to tbl_auths_backup
    3. Copy tbl_Claims to tbl_Claims_backup
    4. Run Make table Query to create tbl_Auths
    5. Run Make table Query to create tbl_claims
    6. Set Warnings on
    7. Close Database

    As soon as step 4 errors There is a halt Macro screen that comes up caused by the error. What I want is if the error occurs copy the tbl_auth_backup back to tbl_auths and just to be safe do the same for tbl_claims and then exit the database.

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,558
    Ray,
    I'm not sure I can help with this. Sorry.
    It might be a good idea to re-post.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change Access 2003 mdb workgroup using Access 2010
    By metsmaniac in forum Security
    Replies: 6
    Last Post: 04-06-2012, 07:56 PM
  2. Access 2010 Macro
    By RayMilhon in forum Access
    Replies: 3
    Last Post: 09-28-2011, 10:37 AM
  3. 2007 to 2010 macro won't work
    By lmnnt in forum Programming
    Replies: 6
    Last Post: 08-10-2011, 12:55 PM
  4. Replies: 17
    Last Post: 08-03-2011, 04:19 PM
  5. Replies: 0
    Last Post: 07-13-2010, 06:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums