Avoiding Errors - Re-Post

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Macro that runs on a scheduler, it runs every 30 minutes and it
updates the our database.

The problem that I have is that if someone has that Table open, the macro
errors out and Locks the database.

what can I add to the macro to ignore the error and either loop until it
works or just ignore the error and close. it runs every 30 minutes and for
only a 10 hour period.

The error is 3051, cannot open file, it is already open or you do not have
permissions.


*** Side note, I want to go on vacation and not have to worry about taking
my Laptop to check for errors ***

Thanks,
 
Macros ... "we don' need no steenken' errors!"

Macros do not have error handling (at least in the historical versions of
Access - which version are you using?).

If you want error handling, you'll need to look into creating VBA
procedures/code modules.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff,

I am running '03

Since I run a Batch file that runs the Macro... is ther somethin simular to
do this with a module?

This is what is in the batch file...

"C:\Program Files\Microsoft Office\OFFICE11 _ \Msaccess.exe"
"C:\OPSEC\OPSEC.MDB" /x "macAutoEMail"


Thanks Again in Advance
 
Can you have your batch file run a procedure instead? You could convert
your Macro to a procedure and add error handling code in the procedure?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
From within Access, (depending on version), you can convert a macro to a
procedure at a click-of-a-button. You'll still need to do the coding to
handle errors.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top