Avoiding Errors - Re-Post


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,
 
Ad

Advertisements

J

Jeff Boyce

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
 
G

Guest

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
 
J

Jeff Boyce

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
 
Ad

Advertisements

J

Jeff Boyce

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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top