Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving records from one table to another 1

Status
Not open for further replies.

tomf

IS-IT--Management
Feb 18, 2000
9
US
What is the best way to move records from one table to another? I have created a simple database that tracks projects. I have a status flag in the project master table. This field is set to either “1” for open or “2” for closed. I would like to take all closed records and move them to another table and delete them from the first table. Thanks for any help.<br>
<br>
Tom F
 
tomf,<br>
SQL is the fastest and easist, ie<br>
<br>
Insert into Table2 Select * from Table1 where Status = 2<br>
<br>
Delete from Table1 where Status = 2<br>
<br>
If field names are different, or some missing, you just need to adds the correct fields in the Insert statment, you could use Access' qbe designer to do that.<br>
--Jim
 
Or you might do it interactively, pop up a InputBox in the OnUpdate event (if status=2) to ask &quot;Do you want to move this record to the Archive?&quot; etc.
 
Jim & Elizabeth,<br>
<br>
Thanks for the tips. I tried the tip from Jim and it work great.<br>
<br>
Thanks again,<br>
Tom F
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top