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

duplicate data

Status
Not open for further replies.

loneranger27

Programmer
Apr 22, 2003
94
0
0
US
Hi,

I have a form called customers that the user enters the customers information into. then from there he can click a button and go to a form where they can enter products being ordered. The orders table uses an auto number for its primary key. Quite often we have customers with more than one store and we enter each store as a seperate customer because they are all billed seperately.

Is there a way to use the primary key from the order form and attach it to more than one customer? I would like to just enter the primary key number on the oder form for the second customer and hae the data transfer autmatically to the second customer.

I hope this is clearer than mud. Any help is appreciated.

thanks
 
As I understand you have a mainform (orders) and a subform (orderlines) and you want to copy or move lines from one order to another?

Yes this can be done by using a loop and a recordset, let me know if I am on the right track.

Herman

They say that crime doesn't pay... does that mean my job is a crime?
 
I am thinking maybe make a button to move the data to another table then move it back with a new foreign key to match the new record. I am not sure how to change the foreign key.
 
First you make the new entry in your "main" table, then grap that key also grap the records in the sub-table with the "old"-key add those records to your sub-table with the new-key.

If you like you can drop me your email and I will do this little job for you off-line.

Herman

They say that crime doesn't pay... does that mean my job is a crime?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top