I have a parent table named tblParent with one child table named tblChild. The structure is:
tblParent
ParentID
[other fields]
tblChild
ChildID
lngParentID
[other fields]
Background: A form (frmParent) with a record source of tblParent has a subform of tblChild. Two unbound textboxes are included on the subform. The control source of the first is =[CurrentRecord]. The second is =DCount("ChildID","tblChild","lngParentID=" & Forms!frmParent.ParentID). The result after adding a label is, for example, Record 1 of 2 meaning this parent record has two child records and the view is on the first record. So far so good.
My question is how to do this in a query of all parents with each child record identified as record 1, 2, 3, etc. I have a temp table built and am trying to run an update query to populate, but do not know how to query the child records as they relate to the parent and then assign the correct record number.
Ultimately I will run a crosstab on the child record of 1, 2, 3, etc.
Thank you very much for any suggestions or for pointing me to a previous post.
tblParent
ParentID
[other fields]
tblChild
ChildID
lngParentID
[other fields]
Background: A form (frmParent) with a record source of tblParent has a subform of tblChild. Two unbound textboxes are included on the subform. The control source of the first is =[CurrentRecord]. The second is =DCount("ChildID","tblChild","lngParentID=" & Forms!frmParent.ParentID). The result after adding a label is, for example, Record 1 of 2 meaning this parent record has two child records and the view is on the first record. So far so good.
My question is how to do this in a query of all parents with each child record identified as record 1, 2, 3, etc. I have a temp table built and am trying to run an update query to populate, but do not know how to query the child records as they relate to the parent and then assign the correct record number.
Ultimately I will run a crosstab on the child record of 1, 2, 3, etc.
Thank you very much for any suggestions or for pointing me to a previous post.