MULTIPLE QUERIES

  • Thread starter Thread starter NEOFYTOS
  • Start date Start date
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
 
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.
 
Back
Top