View Full Version : Move a Record from one table to another?


ChampionDuy
05-14-2002, 11:47 AM
I cant figure out how to take a record that is in one table and move the entire record to another table. Can I use a parameter query for this. I tried one with an update statement but it did not work. It also needs to delete the record from the table that it comes from.

Rich
05-14-2002, 11:54 AM
It's an append query and then delete.

ChampionDuy
05-14-2002, 12:12 PM
How would I add the delete to the Query? Here is my SQL that appends the record. It works great. Now I just need to delete it from the original table called Casefile. Can I just do a delete right after that statement?


Parameters [Enter CCN of the case you would like to close] value;
INSERT INTO CASE1
SELECT CASEFILE.*
FROM CASEFILE
where casefile.ccn = [Enter CCN of the case you would like to close] ;

David R
05-16-2002, 01:55 PM
The delete query will have the exact same WHERE clause as the Append query, for reasons which should be obvious. Run them right after each other from code or a macro.

It will help to have a way to refer to that case file number again, instead of them having to enter it again. You can do this with input boxes, popup forms, or a button from an existing bound form showing the record in question.

[This message has been edited by David R (edited 05-16-2002).]

ChampionDuy
05-22-2002, 06:06 AM
Thanks It works great