Query in VBA

A

Alain

Hello,

I would like to know if it is possible to programatically
remove the warning msgbox when we are about to delete
recordset from a table, I know it is possible to set it
up in the options, but I want to turn off that option
only in 1 database program, not on all of them

Thanks
Alain
 
K

Ken Snell [MVP]

Use DoCmd.SetWarnings action to turn message on and off.

' Turn off the warning
DoCmd.SetWarning False
' run your query here...
'.....
'
' Turn on the warning
DoCmd.SetWarnings True


Be sure that you put this last step in all your error handling for the
procedure too. Otherwise, if an error occurs that takes the code to the
handler before this last step is run, the warning messages will be turned
off throughout the database until reset by code.
 

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