Query in VBA

  • Thread starter Thread starter Alain
  • Start date Start date
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
 
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.
 
Back
Top