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

C

CMA

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?
 
C

CMA

Thanks for helping me out. I'm slowly learning VBA, and thanks to you my
knowledge is growing.
 
6

'69 Camaro

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top