Open form, go to record on subform

  • Thread starter Thread starter Bradley C. Hammerstrom
  • Start date Start date
B

Bradley C. Hammerstrom

Access2000

This works fine to open a form and then go to the record with the same
PhotoID as the calling form. (OpenArgs is set in the OnClick Event of the
command button.)
*****************
'GoTo same record as frmPhotosPerObs
Private Sub Form_Load()
If Not IsNull(Me.OpenArgs) Then
With Me.RecordsetClone
.FindFirst "PhotoID = " & Me.OpenArgs
If Not .NoMatch Then Me.Bookmark = .Bookmark
End With
End If
End Sub
*****************
Now I want to do a similar thing, only the form I want to open has a subform
and I want to go the matching record on the subform. How do I change the
..FindFirst line to refer to the subform's PhotoID?

Brad H.
 
It seems like you would need two OpenArgs; one to goto the correct parent
record, and then (after moving the focus to the subform) another to goto the
correct child record. Can two OpenArgs statments be "remembered" from the
DoCmd that calls the form?

Brad H.
 
Back
Top