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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with Archiving Records 2

Status
Not open for further replies.

simpsondm

IS-IT--Management
Jan 14, 2003
21
US
Can someone please help me I'm new with databases and learning as I go. I have a projects database and I need to archive closed projects to another table. I have a table called tbl_mainproj and tbl_Archproj that are identical in structure/fields I have 2 yes/no check boxes fldOpen and fldClosed when a project is Open the fldOpen is checked and when it is closed fldClosed is checked.
How can I move the records from tbl_mainproj to tbl_Archproj when fldClosed is checked and delete the record from tbl_mainproj.
Thanks for any help you can provide
 
Hallo

You can write an Append Query:
INSERT INTO tbl_ArchProj * SELECT * FROM tbl_mainproj WHERE fldClosed;
And a Delete Query:
DELETE * FROM tbl_mainproj WHERE fldClosed;

Something like that. Use the Query Builder to create them.
Careful with that DELETE though!

- Frink
 
To spruce up your application, as part of the "Close" procedure, you can either use a command button to "Archive", or when the end user saves a closed project, the AfterUpdate event archives the record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top