How to automatically move one record from one table to another (1 Viewer)

snehal0909

Registered User.
Local time
Today, 13:36
Joined
Feb 4, 2008
Messages
74
Say i have two tables
1 = computers (it holds info about the computers)
2 = Repair (this table holds only the PCs that are under repair)

I want to be able to move one computer record to Repairs table as soon as i select that "this pc is under repair" on a form. So it does not show up on my report of computers in hand and shows up on computers in repair.

and when i get the pc back from repair, i want to be able to select "back in stock" and it'll move the record back to Computers tables & removes tht record from repairs table

is there a way i can do this automatically (without manually move a record)?

Any suggestions - web links or examples will be much appreciated.

Thank you
 
M

Mike375

Guest
If the tables have fields that match then an Append query is run followed by an Delete query. To come the other way it is the same but the Append and Delete query swap tables. If you do this make sure it is automated so you don't run the Delete query first.

But a better way (and I think the more common way) is to leave the records in the same table and have one of the fields mark whether the computer is under repair or whatever. Thus you might have an S for "in stock" and R for "at repair" and a query can select the records on that basis. Such a query could then be the basis of your form or report.
 

snehal0909

Registered User.
Local time
Today, 13:36
Joined
Feb 4, 2008
Messages
74
The second solution seems perfect.

Thanks Mike!
 

Users who are viewing this thread

Top Bottom