J
jhanby1
I am trying to navigate to a specific record in a recordset, which I
think is working, but I need the record to be displayed on a
subform(fsubCaseDetails) on my main form (frmMainPage). Below is the
code. Any ideas?
Private Sub cmdGoToCase_Click()
' Find the record that matches the control. If no match, display
message box.
Dim rs As Object
If IsNull(Me!txtGoToCase) = True Then
Msgbox "You must enter in a Case Number to search.", vbOKOnly,
"Missing Selection"
Else
Me.FilterOn = False
Set rs = Me.Recordset.Clone
rs.FindFirst "[CaseNumber] = '" & Me![txtGoToCase] & "'"
If rs.NoMatch = True Then
Msgbox "The number you entered, " & Me![txtGoToCase] & ",
is not a valid Case Number. " & _
"Please check the Case Number and try again.", vbOKOnly
Exit Sub
End If
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.txtGoToCase = ""
End If
End Sub
think is working, but I need the record to be displayed on a
subform(fsubCaseDetails) on my main form (frmMainPage). Below is the
code. Any ideas?
Private Sub cmdGoToCase_Click()
' Find the record that matches the control. If no match, display
message box.
Dim rs As Object
If IsNull(Me!txtGoToCase) = True Then
Msgbox "You must enter in a Case Number to search.", vbOKOnly,
"Missing Selection"
Else
Me.FilterOn = False
Set rs = Me.Recordset.Clone
rs.FindFirst "[CaseNumber] = '" & Me![txtGoToCase] & "'"
If rs.NoMatch = True Then
Msgbox "The number you entered, " & Me![txtGoToCase] & ",
is not a valid Case Number. " & _
"Please check the Case Number and try again.", vbOKOnly
Exit Sub
End If
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Me.txtGoToCase = ""
End If
End Sub