I'm still trying to copy details from a form and subform (fixed price list of around 200 options) to a newly-created different form and subform.
The main form, as it's only one record copies over perfectly, but the subform, which contain 4 to 10 records, only copies the first record. The code I'm using:
DocName = "New Service Loading - add"
DoCmd.Close A_FORM, "New Service Loading"
DoCmd.OpenForm DocName, , , , A_ADD
Forms![ServiceLoading]![jobref] = Me![jobref]
Forms![ServiceLoading]![Model] = Me![Model]
Forms![ServiceLoading]![servjob] = Me![servjob]
Forms![ServiceLoading]![labrate] = Me![labrate]
Forms![ServiceLoading]![labhrs] = Me![labhrs]
Forms![ServiceLoading]![labcost] = Me![labcost]
Forms![ServiceLoading]![wasteoil] = Me![wasteoil]
Forms![ServiceLoading]![Sundries] = Me![Sundries]
Do
Forms![ServiceLoading]![slsubform]![partid] = Me![fpsubform]![partid]
Forms![ServiceLoading]![slsubform]!{qty] = Me![fpsubform]![qty]
Forms![ServiceLoading]![slsubform]![BinLocation] = Me![fpsubform]![Bin Location]
Exit Do
Loop Until Me![fpsubform]![qty] < 1
Frink came up with a good suggestions pasting in a SQL statement - but it didn't work.
Thanks for any help,
Mike
The main form, as it's only one record copies over perfectly, but the subform, which contain 4 to 10 records, only copies the first record. The code I'm using:
DocName = "New Service Loading - add"
DoCmd.Close A_FORM, "New Service Loading"
DoCmd.OpenForm DocName, , , , A_ADD
Forms![ServiceLoading]![jobref] = Me![jobref]
Forms![ServiceLoading]![Model] = Me![Model]
Forms![ServiceLoading]![servjob] = Me![servjob]
Forms![ServiceLoading]![labrate] = Me![labrate]
Forms![ServiceLoading]![labhrs] = Me![labhrs]
Forms![ServiceLoading]![labcost] = Me![labcost]
Forms![ServiceLoading]![wasteoil] = Me![wasteoil]
Forms![ServiceLoading]![Sundries] = Me![Sundries]
Do
Forms![ServiceLoading]![slsubform]![partid] = Me![fpsubform]![partid]
Forms![ServiceLoading]![slsubform]!{qty] = Me![fpsubform]![qty]
Forms![ServiceLoading]![slsubform]![BinLocation] = Me![fpsubform]![Bin Location]
Exit Do
Loop Until Me![fpsubform]![qty] < 1
Frink came up with a good suggestions pasting in a SQL statement - but it didn't work.
Thanks for any help,
Mike