Running Queries

  • Thread starter Thread starter ml
  • Start date Start date
M

ml

I am not an expert at coding, so hopefully my description
will be clear.

I am executing Delete and Update queries using the
DoCmd.OpenQuery command. That works great, but the system
pops up messages to the user to confirm the deletion or
the update. My thoughts are to do one of two things:

1)Is it possible to perform these types of queries so that
the "standard" messages do not pop up?

2)Is it possible to access the user responses to
these "standard" messages?

Either way, I am thinking it would allow me to control the
rest of the process within my code and keep the user
confusion down.

Thanks.
 
Sure there is...
Use the following:

currentdb.Execute "DELETE * FROM TABLENAME"

or

wrap DoCmd.Setwarnings = Fasle or DoCmd.Setwarnings = True
around your DoCmd.Openquery
 
Use the following:

currentdb.Execute "DELETE * FROM TABLENAME"

It's better to catch errors with

db.Execute strSQL, dbFailOnError

otherwise you'll never know if it worked or not...


Tim F
 
Back
Top