How Do I Supress Update Dialog Box Programmatically

G

Guest

I am programmatically updating specific fields in my database. When the macro
runs it pauses to show a dialog box asking for confirmation on updating the
database. I do not want the macro to be stopped by this dialog box any longer.

In VBA for Excel I would have used Application.DisplayAlerts = False. Your
help is welcome. Thanks.
 
K

Ken Snell [MVP]

In ACCESS macro (which is not VBA code!), you use the SetWarnings action.
Set it to No to turn off the alert box; set it to Yes to turn on the box.

In VBA code, you use the
DoCmd.SetWarnings False ' turns off warning boxes
or
DoCmd.SetWarnings True ' turns on warning boxes


As in EXCEL, be sure you turn the warnings back on if you use VBA code, and
be sure to do that in any error handlers that you use too.
 
G

Guest

Thanks Ken, I'm sure that will get the result I am looking for.

And, thanks for correcting me on calling a macro VBA code. I'll have to be
more careful about that.

Just out of curiosity, when you access the Visual Basic Editor in Access do
you select it from a submenu under the Tools dropdown menu? If yes, what does
your version of Access call that submenu? In the software I use, both Access
and Excel label that submenu with the same name. I'd be interested to hear
what label you encounter in your version.
 
K

Ken Snell [MVP]

Yes. In the database window of my ACCESS 2002:

Tools | Macros | Visual Basic Editor
 
G

Guest

That's what I thought.

So, did you simply mean to point out that Access has a UI for making macros,
which is distinct from the Visual Basic Editor when you wrote "ACCESS macro
(which is not VBA code!)"? Or, were you actually trying to inform me that VBA
code written in the Access Visual Basic Editor is not an Access macro?
 
K

Ken Snell [MVP]

What I mean is "VBA code written in the Access Visual Basic Editor is not an
Access macro".

A macro in ACCESS is a completely different thing from VBA, although there
is a wizard in ACCESS that will "convert" a macro to very old-style VBA
code.
 
G

Guest

Okay, I see what you mean now.

Because the submenu which holds Visual Basic Editor is labeled Macros would
you allow the possibility that it may have been the intention of the creators
of Access and Excel, that VBA written in the Visual Basic Editor would be
called a macro?
 

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