G
Guest
Hi
I have two subforms on my form which are using same reference to the main
form.
The main form consists main record number (Purchase order number)
subform is a materials list for that purchase order.
second subform is in fact query which summarises how many of these materials
were delivered (basing on other form/table). So as result I'm getting a list
showing how many materials from PO were delivered. Now, I want to synchronise
these two subforms, so when I'm scrolling one, the other one follows. I found
one post in which there was a code for current event in both subforms:
Private Sub Form_Current()
Dim rs As Recordset
If (Not IsNull(Me![ID])) And _
(Not IsNull(Parent.OtherSubFormControl.Form![ID])) And _
(Me![ID] <> Parent.OtherSubFormControl.Form![ID]) Then
Set rs = Parent.OtherSubFormControl.Form.RecordsetClone
rs.FindFirst "ID = " & Me![ID]
If Not rs.NoMatch Then
Parent.OtherSubFormControl.Form.Bookmark = rs.Bookmark
End If
End If
End Sub
Now, maybe it's correct, but could anyone explain what [ID] is.
Is it a lookup ID to the main form? If yes, my subform doesn't contain it.
I've made both subforms using wizard and they contain only data I've picked
for display on main form.
PLease help.
I have two subforms on my form which are using same reference to the main
form.
The main form consists main record number (Purchase order number)
subform is a materials list for that purchase order.
second subform is in fact query which summarises how many of these materials
were delivered (basing on other form/table). So as result I'm getting a list
showing how many materials from PO were delivered. Now, I want to synchronise
these two subforms, so when I'm scrolling one, the other one follows. I found
one post in which there was a code for current event in both subforms:
Private Sub Form_Current()
Dim rs As Recordset
If (Not IsNull(Me![ID])) And _
(Not IsNull(Parent.OtherSubFormControl.Form![ID])) And _
(Me![ID] <> Parent.OtherSubFormControl.Form![ID]) Then
Set rs = Parent.OtherSubFormControl.Form.RecordsetClone
rs.FindFirst "ID = " & Me![ID]
If Not rs.NoMatch Then
Parent.OtherSubFormControl.Form.Bookmark = rs.Bookmark
End If
End If
End Sub
Now, maybe it's correct, but could anyone explain what [ID] is.
Is it a lookup ID to the main form? If yes, my subform doesn't contain it.
I've made both subforms using wizard and they contain only data I've picked
for display on main form.
PLease help.