run a quety without a warning

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

Guest

what code do I write to run a query without getting a warning ?
and I dont want to set it by the access options because then it dose not
warn me by running any query.
 
You can either issue a DoCmd.SetWarnings False before running the query, and
DoCmd.SetWarnings True afterwards, or you can use the Execute method of the
QueryDef object. I prefer the latter, because it also allows you to specify
dbFailOnError as an option, meaning that a trappable error will be raised if
something goes wrong running the query.

CurrentDb.QueryDefs("MyActionQuery").Execute dbFailOnError
 
Back
Top