Replace or supress a standard dialog box

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

Guest

I am writing an event which runs a make table query. I am concerned that
users will be confused by the standard dialog boxes which give the user
warning that they will be writing records to a new table and that they will
be overwriting existing records in the table.

Is it very difficult to either replaces these messages with one of my own,
or just eliminate the box all together.

Thanks so much
 
In brief, there is something called "SetWarnings". You can set that in
vba, or in a "Macro". Change it to No.
 
I think what you want is...

DoCmd.SetWarnings False
****Your code goes here****
DoCmd.SetWarnings True

This will turn the warnings off, run your event and then turn them back on.

HTH,
Gina Whipp
 
Lele,

If you use the SetWarnings/No action in a macro, the setting reverts
automatically at the end of the macro. But if you are using a VBA
procedure, it is important to restore the Warnings by putting
DoCmd.SetWarnings True
.... after the query.
 
It is faster and natively silent to do this with the DAO Execute method.

dim db
dim sqltext

set db = currentdb

sqltext = "myUpdateQuery"
' Or, you can type the entire query, like
' sqltext = "SELECT * INTO..."

db.execute sqltext

set db = nothing
 

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

Back
Top