Hi
In a nav form's default subform I want to add a search facility (text box and button). In the button OnClick event I want another subform to open with the searched record.
I have the below code for my search button but I don't know what to add to get it to open the result in another subform.
In a nav form's default subform I want to add a search facility (text box and button). In the button OnClick event I want another subform to open with the searched record.
I have the below code for my search button but I don't know what to add to get it to open the result in another subform.
Code:
Private Sub btnSrch_Click()
If IsNull(SearchBox) = False Then
Me.Recordset.FindFirst "[OldID]=" & SearchBox
Me!SearchBox = Null
If Me.Recordset.NoMatch Then
MsgBox "No Record Found", vbOKOnly + vbInformation, "Sorry"
Me!SearchBox = Null
End If
End If
End Sub