Archive table

hackintosh

New member
Local time
Today, 07:00
Joined
Feb 21, 2008
Messages
1
Dear people,

I am relatively new to Access 2007 but I have an assignment to do so I need to get this thing working.

So I have a table - tblTRAY.

What I have to do is copy this table (with the information) to table tblArchive.

Then I have to empty tblTRAY but keep the structure.

Can you tell me how to do that with a marco

Thanks in advance
 
Try not to use marcos and focus on learning VBA instead it will be more beneficial in the long run.

Code:
Dim SQL as string

'insert the data into the tblarchive
SQL ="SELECT tblTray.* INTO tblArchive FROM tblTray" 
CurrentDB.Execute SQL 

'Delete the records from the old table. 
CurrentDB.Execute "DELETE * FROM tblTray"

Another option would be to keep everything within your table tray and have a yes/no check box named ARCHIVED. Then to archive records you can check it (i.e = yes).


Dallr
 

Users who are viewing this thread

Back
Top Bottom