Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronized Scrolling

Status
Not open for further replies.

rknmsp

Programmer
Sep 9, 2004
9
US
Does anyone know if it is possible to have a form with 2 subforms, and to have the subforms both be able to be navigated by a single scroll bar on the main form?

Thanks
 
I have a similar system where I have 3 subforms on a main form. One of the subforms has a listbox that when clicked synchronises the other two subforms by scrolling their records to make the visible. Is this the sort of thing you are looking for? if so read on.

the two slave subforms have sub called synchform which as follows:

Public Sub SynchForm(MetId As String)
On Error Resume Next

Me.RecordsetClone.FindFirst "[Met_Id] = " & MetId & ""
Me.RecordsetClone.MovePrevious
If Me.RecordsetClone.BOF = True Then
Me.RecordsetClone.MoveFirst
Else
Me.RecordsetClone.MovePrevious
End If
Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub

In my case Met_Id is the field that links the forms together.

The list box on the controlling subform as part of its on_click event calls this procedure for the other two subforms as so:

Private Sub LstMET_Click()
On Error Resume Next
Dim frm As Form

Set frm = Forms!frmFleetStrengthsHours

frm![Child13].Form.SynchForm (LstMet)
frm![Child102].Form.SynchForm (LstMet)
frm![Child13].Form.Refresh
frm![Child102].Form.Refresh

blah blah

Shout if you need more help
HTH

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top