If the main form and subform are already linked (I presume that you using the LinkMasterFields and LinkChildFields properties to do this), then all you need to do is force the main form to the record you want; the subform will follow.
Add the following code to the AfterUpdate event of your combo box:
Private Sub cmbYourCombo_AfterUpdate()
Dim F As Form: Set F = Me
F.RecordsetClone.findfirst "SearchField = " & cmbYourCombo.Column(0)
F.Bookmark = F.RecordsetClone.Bookmark
End Sub
Notes:
(a) Modify the cmbYourCombo and YourSearchField references as appropriate.
(b) YourSearchField should refer to the unique field in the table behind the main form; this of course should be used as the row source behind your combo.
(c) The .Column(0) bit assumes that you are interested in synching the forms based on the first column of the combo box. Modify this as appropriate.
(d) The code at present does'nt incorporate error handling; eg. if the combo entry doesnt exist. To protect against this, set the LimitToList property of the combo to Yes, and ensure that the combo recordsource matches the main forms.
(e) You could enhance this logic to make it bullet proof using error handling, or to make it work based on a compound primary key (say).
Let us know if this satisfies your immediate requirement,
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)