Insert Into?? (1 Viewer)

TimjHebert

Registered User.
Local time
Yesterday, 18:07
Joined
Dec 12, 2004
Messages
40
I have a 2 identical databases. One named customerrent and the other customerhistory. Both databases contain related tables.
tblcustomer
tblrent
What i would like is a button on my form to archive the current record, to the customerhistory database then delete that same record from the customerrent database. Can someone give me an example how to accomplish this?

Thanks in advance!
Tim
 

FoFa

Registered User.
Local time
Yesterday, 18:07
Joined
Jan 29, 2003
Messages
3,672
What I like to do in this situation, is make sure you have a good primary key.
1-Create a query to "pull" the primary Key from your Form (or whatever you use as a selection) that appends this row from the main table to the archive table.
2-Have a Dcount (or some thing like that) to also pull the primary key from the form, and verify the write is good to the archive table.
3-Then have another query (delete) remove that primary key from the main table (as long as the write was good).
4-refresh the current form to reflect the deletion
 

Users who are viewing this thread

Top Bottom