Delete Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all, is there any way to delete a record from a table using a command
buton on a form. But, here is the kicker I want the deleted records to be
sent to a table called history.

If this is possible please HELP
 
Create an Append query to add the record to the history table
Create a Delete query to delete it from the main table
In the click event of the button:

CurrentDb.Execute("MyAppendQuery"), dbFailOnError
CurrentDb.Execute("MyDeleteQuery"), dbFailOnError
 
I understand all of that but do you think you can get me started in the right
direction.
For the append and delete queries, should I just enter the same fields as my
original table, then build another table(Archive table) with the same fields
as my original table.

What kind of sql coding should I use
 
Yes

BIGRED56 said:
I understand all of that but do you think you can get me started in the right
direction.
For the append and delete queries, should I just enter the same fields as my
original table, then build another table(Archive table) with the same fields
as my original table.

What kind of sql coding should I use
 
Thank you for the information it was very useful. I have both my delete and
append query working, but I have one question. The append query has an input
box appearing that asks the user for a certain number in a certain field. It
appends the Number I want it to, but the delete query delets all files. How
can I have the delete query delete only the selected records typed into the
append query, with out having another input box.

Thanks...
 
Create a control on your form to enter the parameter value and have both
queries reference it in the criteria row of the field that you want to filter
on. It has to be fully qualified for the query to be able to find it:

Forms!MyFormName!MyControlName
 
Back
Top