Delete more than 1 tables in one Query?

P

perrycheung221

Hi all,

i would like to ask if we can delete more than 1 tables in one query
in Access?

It would be something like

Delete * From tableA; Delete * From tableB;

[they are located in the same query]

Thanks!!
 
A

Allen Browne

No. You have multiple SQL statements in a single query in Access.

You can achieve the same result by calling a macro, or using code like this:
Dim db As DAO.Database
db.Execute "Delete * From tableA;", dbFailOnError
db.Execute "Delete * From tableB;", dbFailOnError
 
P

perrycheung221

Oh..icic, Thanks for that!! :)

Perry

No. You have multiple SQL statements in a single query in Access.

You can achieve the same result by calling a macro, or using code like this:
Dim db As DAO.Database
db.Execute "Delete * From tableA;", dbFailOnError
db.Execute "Delete * From tableB;", dbFailOnError

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.




i would like to ask if we can delete more than 1 tables in one query
in Access?
It would be something like
Delete * From tableA; Delete * From tableB;
[they are located in the same query]
Thanks!!- Hide quoted text -

- Show quoted text -
 

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