Hi.
I am trying to copy a record which has data in 3 tables, and replicate it in the same set of tables, but with a different ID number.
I know how to write an InsertInto statement, but what i'm not sure of, is how to copy the new id (that has been set by autonumber) into the other 2 tables, so that the record remains linked and whole.
In tblJobs, I have JobID (primaryKey), Date, Customer,OrderNumber
In tblLoads, I have LoadID, JobID, PUPostcode, DELPostcode
in tblVia, I have ViaID, LoadID, VPUPostcode, VDELPostcode
1 job can have many loads, and 1 load can have many Vias.
If a job is repeated, I need to copy the job, including the load and via details, and duplicate it with the latest ID number. My ID numbers are created using AutoNumber.
If anyone could help me with how to write the multiple insertinto, i'd be very grateful.
Thanks
I am trying to copy a record which has data in 3 tables, and replicate it in the same set of tables, but with a different ID number.
I know how to write an InsertInto statement, but what i'm not sure of, is how to copy the new id (that has been set by autonumber) into the other 2 tables, so that the record remains linked and whole.
In tblJobs, I have JobID (primaryKey), Date, Customer,OrderNumber
In tblLoads, I have LoadID, JobID, PUPostcode, DELPostcode
in tblVia, I have ViaID, LoadID, VPUPostcode, VDELPostcode
1 job can have many loads, and 1 load can have many Vias.
If a job is repeated, I need to copy the job, including the load and via details, and duplicate it with the latest ID number. My ID numbers are created using AutoNumber.
If anyone could help me with how to write the multiple insertinto, i'd be very grateful.
Thanks