VBA Code to auto perform append/delete queries (no user input)

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

Guest

I have a form with a command button, and once this button is pressed I've
programmed it to run an append query, then a delete query.

However, for each of these item, Access requires users to respond to message
to confirm these actions. I would like to by-pass this user confirmation.

How is this accomplished in VBA?
 
Thanks for helping me out. I'm slowly learning VBA, and thanks to you my
knowledge is growing.
 
Hi.
How is this accomplished in VBA?

Use the Execute method to execute action queries. For example:

CurrentDb().Execute "UPDATE MyTable SET State = 'New York';",
dbFailOnError

Users won't be prompted unless the query fails (which is exactly when you
want to know the operation failed), and it runs faster than RunSQL or
OpenQuery.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
Blogs: www.DataDevilDog.BlogSpot.com, www.DatabaseTips.BlogSpot.com
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.
 
Back
Top