MULTIPLE QUERIES

N

NEOFYTOS

Hello my name is neofytos
i use access 2007

i have prepared five delete queries (Q1,Q2,Q3,Q4,Q5)
i want these queries to run together using only one command
i know that this can be done with Macro or VBA but i do not know the way
i need somebody to help me
 
D

Daniel Pineault

Depends.

You could use DoCmd.RunsSQL and copy your SQL statement directly into VBA
and run them this way.

Dim db as DAO.Database
Dim strSQL as String
Set db = DbEngine(0)(0)
strSQL ="Your SQL Statement Would Go Here"
db.Execute StrSQL, dbFailOnError

Or,

You could use currentdb.execute to run existing queries (see the help file
for details and examples).

Or,

You could also use DoCmd.OpenQuery (see the help file for details and
examples).
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 

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