Run in "Quiet" mode

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
J

Jim Shaw

BlankIn Access 2002 VBA I'm using the DoCmd.RunSQL to execute an action
query. At execution time, the query generates verification messages
requiring the user to click OK to continue.

How can I run these queries without generating the verification messages?

Thanks

Jim Shaw
 
Try:
DoCmd.SetWarnings False
Remember to turn it back on.

Alternatively:
dbEngine(0)(0).Execute strSQL, dbFailOnError
runs without needing to toggle SetWarnings, and has the added advantage of
telling you if a problem occurred, and also allows you to use transactions
if you need to rollback on error.
 
Thanks Allen
-Jim

Allen Browne said:
Try:
DoCmd.SetWarnings False
Remember to turn it back on.

Alternatively:
dbEngine(0)(0).Execute strSQL, dbFailOnError
runs without needing to toggle SetWarnings, and has the added advantage of
telling you if a problem occurred, and also allows you to use transactions
if you need to rollback on error.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

messages?
 
Back
Top