transfer to Archive table (1 Viewer)

jayme27

Registered User.
Local time
Today, 20:44
Joined
Nov 24, 1999
Messages
34
Let's say my table has a primary key (yes it is text field called NAME, not a number field). Then what would I use instead of using the current record's ID in my code? Please be specific. Here is what I have so far to transfer record to different table before deleting it from main table.

Both of these commands can be on one button click:

Private Sub cmdDoIt_Click()

CurrentDB.Execute "INSERT INTO tblArchive SELECT * FROM tblThisTable WHERE ID =" & Me!ID

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDelete

End Sub

ALL IS UNDERSTOOD EXCEPT AFTER the WHERE. THank you
 

Users who are viewing this thread

Top Bottom