Sync to Sub Forms

  • Thread starter Thread starter Chris B
  • Start date Start date
C

Chris B

does anyone know how to sync to subforms so that as one
changes, the other stays with it?

thanks
 
use the current event of the subforms to do a find in the recordset of the
other subform. If you do this with both subforms then they will stay in
sync:
open each subform in design view and code like so:

Private Sub Form_Current()
Dim rs As DAO.Recordset

Set rs = Forms!FormName!SubformControlName.RecordsetClone
rs.FindFirst "[Service] = " & Me.Service
If Not rs.NoMatch Then Forms.Information.Bookmark = rs.Bookmark
rs.Close
End Sub
replace the FormName and SubformControlName accordingly. Also Service will
be the unique indentifier for each recordset that the subforms have in
common.
HTH
 
Back
Top