E
efandango
I have a form that has a field called Run_No, when I click it, it will take
me to the matching Run_No on another form 'frm_Runs'. So far, so good. But I
need it to take me first to the Run No, and then to the matching 'Point Id'
on the 'frm-points' form which is a subform of frm_Runs; as in this example:
Forms![frm_Runs]![frm_Points].Form![Point_ID]
So in summary; I want it to first match the Run_No, and then the Point_ID,
and go to that form/subform/record.
I have this code below, that will do the first part, eg: find the matching
Run_No, but I don't know how to incporporate the second part to include the
matching Point_ID
my code:
Private Sub Run_No_Click()
Dim rs As DAO.Recordset
With Forms!frm_Runs
Set rs = .RecordsetClone
' rs.FindFirst "Run_No=""" & Me!Run_No & """"
rs.FindFirst "Run_No=" & Me!Run_No & ""
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
Forms![frm_Runs]![Run_No].SetFocus
'Parent.[frm_Run_No].SetFocus
.Run_No.SetFocus
Else
MsgBox "no matching record found"
End If
'End If
Set rs = Nothing
End With
End Sub
me to the matching Run_No on another form 'frm_Runs'. So far, so good. But I
need it to take me first to the Run No, and then to the matching 'Point Id'
on the 'frm-points' form which is a subform of frm_Runs; as in this example:
Forms![frm_Runs]![frm_Points].Form![Point_ID]
So in summary; I want it to first match the Run_No, and then the Point_ID,
and go to that form/subform/record.
I have this code below, that will do the first part, eg: find the matching
Run_No, but I don't know how to incporporate the second part to include the
matching Point_ID
my code:
Private Sub Run_No_Click()
Dim rs As DAO.Recordset
With Forms!frm_Runs
Set rs = .RecordsetClone
' rs.FindFirst "Run_No=""" & Me!Run_No & """"
rs.FindFirst "Run_No=" & Me!Run_No & ""
If Not rs.NoMatch Then
.Bookmark = rs.Bookmark
Forms![frm_Runs]![Run_No].SetFocus
'Parent.[frm_Run_No].SetFocus
.Run_No.SetFocus
Else
MsgBox "no matching record found"
End If
'End If
Set rs = Nothing
End With
End Sub