Delete Queries

  • Thread starter Thread starter Gregg
  • Start date Start date
G

Gregg

I have several delete queries that display the following
error message:

"could not delete from specified tables"

I've heard though a friend that I can't include multiple
tables as part of this type of action. Is this correct?
If so, how can I delete the contents of multiple tables
all at once without having to wrote code or create a
single delete query for each table? I'd like to keep all
functions in queries if possible.

Thank you for your help.
 
Are you asking whether you can delete from more than one table
simulataneously? If so, then the answer is no, you can't.

Perhaps if you explain what you're trying to do, someone will be able to
suggest an approach.
 
I simply want to delete the contents of multiple tables
simultaneously using a query rather than code.
 
You can't. You must use multiple queries, one for each table. You can create
VBA code to wrap it all up in a transaction, so either all tables get
deleted, or none do.
 
can u please give me example for its vba code?
my case is i have 2 tables.i want to delete its records in
one go.
 
Function ClearTables()

DoCmd.RunSQL "Delete * from PreProduction", -1
DoCmd.RunSQL "Delete * from PlannedOrder", -1

End Function
 
Back
Top