Turn off "alerts" to save/delete tables

G

Guest

Hi,

I am trying to run a Macro that runs 3 queries. In the process tables are
being deleted/created and there are a lot of prompts to save/delete etc... I
just want to turn these off. I got some advice but was having a few issues
implementing them.

Here is where I am so far.

In the Macro - I tried to turn off the alerts at the beginning and then turn
them on again.

OpenModule:
OpenQuery:
OpenQuery:
OpenQuery:
OpenModule:

End of macro...

In OpenModule:
ModuleName = Module1
Procedure = SetOff

In Module1 I have
//////////////////////////////////////////////////////
Option Compare Database

Function SetOff()
DoCmd.SetWarnings = False
End Function
///////////////////////////////////////////////////////

When I run this - the module box appears and the prompts still appear.

Thanks for your help!
 
G

Guest

At the beginning of the macro make the first action SetWarnings No.

I don't think that you really need the OpenModule.

Here's the important part: Make the last action SetWarnings Yes

You will regret it some day if you don't turn warnings back on!
 

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