Hello all,
I've scoured the forum for this, but none of the items seem to be what I'm after (or I can't quite understand them so don't realise they are what I am after!). I'll outline my problem and what I think I need to do.
I have a parent form that contains a subform (displayed as a continuous form). The parent form is unbound, the subform is bound to a table. Users can enter items on the subform (it's a data entry form so no records from the table will be visible) and these appear in the bound table. All ok so far. What I need to do is loop through the continuous form and get the value of the ID field (this is an autonumbered hidden field on the form) so that this can be inserted along with a ProjectID in a junction table (the Project ID is passed into an unbound textbox on the parent form). I know I could get it working if it was just a standard form with one record, but I can't seem to get my head around how I loop through a variable number of records on a continuous form and pick out one value.
I know I can use an INSERT INTO SQL statement to put stuff into the junction table - I just don't know how to loop it through the continuous form to pick up the ID so if someone could show me how to construct the loop I can take it from there.
Any help would be greatly appreciated.
I've scoured the forum for this, but none of the items seem to be what I'm after (or I can't quite understand them so don't realise they are what I am after!). I'll outline my problem and what I think I need to do.
I have a parent form that contains a subform (displayed as a continuous form). The parent form is unbound, the subform is bound to a table. Users can enter items on the subform (it's a data entry form so no records from the table will be visible) and these appear in the bound table. All ok so far. What I need to do is loop through the continuous form and get the value of the ID field (this is an autonumbered hidden field on the form) so that this can be inserted along with a ProjectID in a junction table (the Project ID is passed into an unbound textbox on the parent form). I know I could get it working if it was just a standard form with one record, but I can't seem to get my head around how I loop through a variable number of records on a continuous form and pick out one value.
I know I can use an INSERT INTO SQL statement to put stuff into the junction table - I just don't know how to loop it through the continuous form to pick up the ID so if someone could show me how to construct the loop I can take it from there.
Any help would be greatly appreciated.