can queries be combined?

  • Thread starter Thread starter Dave Cullen
  • Start date Start date
D

Dave Cullen

Can I make an append/delete query in Access? What I'm looking to do is
to save a record in one table when a delete is perfrmed on another
table. This way I'll have a record that the delete was executed.

Thanks

drc
 
There are many facets to your question.

You can capture the record being deleted in the Delete event of the form.
Copy it to a temp table. Then in the AfterDelConfirm event of the form, if
the deletion was not cancelled, copy the record(s) being deleted to the real
table. Details:
Audit Trail - Log changes at the record level
at:
http://allenbrowne.com/AppAudit.html

A somewhat simpler alternative is to prevent the user performing a delete
through the normal interface, and provide your own "Delete" button that
Executes an Append and then a Delete query statement, preferably in a
transaction for an all-or-nothing result. For info on transactions, see:
Archive: Move records to another table
at:
http://allenbrowne.com/ser-37.html
 
There is no form. I'm trying to do this with a simple query in design
mode if possible.

I have a delete query that will delete all records in WO_DATA table
where the criteria in the WO_NUMBER column is whatever value I enter in
design mode.

I also have an append query that will save a record of the current time
and date in WO_STATUS table, showing that data for the same WO_NUMBER
entry was deleted.

I'm just looking for a way to call the append query automatically when
the delete query is run.

drc
 
Access does not have "triggers", so there is no way to capture the records
being deleted if you allow the user to access the tables or queries
directly.
 
Back
Top