SurreyNick
Member
- Local time
- Today, 06:59
- Joined
- Feb 12, 2020
- Messages
- 127
I have been trying to find the answer to this but without success. I want to populate a subform from the record I select in another subform.
I have attached a screen grab of the form to illustrate.
My parent form [MainForm] has two subforms [SubFrmA] and [SubFrmB]. The underlying data is provided by two queries [qryStudents] and [qryClasses] respectively. The subforms display different data but have StudentID (not visible) as a common field and I have set the Link Master and Link Child fields of SubFrmB to this field.
The text box on the parent form filters the records of SubFrmA based upon the text string typed into it. In the pic you can see I have 7 records which all share the string “gre”. As the records in SubFrmA change the content of SubFrmB also changes, displaying the classes attended for the current i.e. first record (in this instance 11X2 for Campbell) but if I click the record selector for one of the other six records in SubFrmA e.g. McGregor the result of SubFrmB remains unchanged i.e. it stays focused on record 1.
I am sure there is a straightforward bit of code which will do the trick but I can’t find it.
Can someone help?
Thanks.
Nick
I have attached a screen grab of the form to illustrate.
My parent form [MainForm] has two subforms [SubFrmA] and [SubFrmB]. The underlying data is provided by two queries [qryStudents] and [qryClasses] respectively. The subforms display different data but have StudentID (not visible) as a common field and I have set the Link Master and Link Child fields of SubFrmB to this field.
The text box on the parent form filters the records of SubFrmA based upon the text string typed into it. In the pic you can see I have 7 records which all share the string “gre”. As the records in SubFrmA change the content of SubFrmB also changes, displaying the classes attended for the current i.e. first record (in this instance 11X2 for Campbell) but if I click the record selector for one of the other six records in SubFrmA e.g. McGregor the result of SubFrmB remains unchanged i.e. it stays focused on record 1.
I am sure there is a straightforward bit of code which will do the trick but I can’t find it.
Can someone help?
Thanks.
Nick