T
tmaxwell
I have a Database Named Contacts, I need to be able to enter a name or
address any of the fields I could search on. I am not sure this is the
correct code for doing this, but I need help . Please
Private Sub Button197_Click()
On Error GoTo Err_Button197_Click
Dim strWhere As String
If Not IsNull(Me.TxtSearch) Then
strWhere = "QRY_NAMES = """ & Me.TxtSearch & """"
End If
DoCmd.OpenForm "QRY_NAMES, , , strWhere"
Rem Err_Button197_Click:
Rem MsgBox "Error finding record: " & Error$
Rem RetVal = False
Rem Resume Next
Rem MsgBox Error$
Rem Resume Exit_Button197_Click
Exit_Button197_Click:
Exit Sub
End Sub
address any of the fields I could search on. I am not sure this is the
correct code for doing this, but I need help . Please
Private Sub Button197_Click()
On Error GoTo Err_Button197_Click
Dim strWhere As String
If Not IsNull(Me.TxtSearch) Then
strWhere = "QRY_NAMES = """ & Me.TxtSearch & """"
End If
DoCmd.OpenForm "QRY_NAMES, , , strWhere"
Rem Err_Button197_Click:
Rem MsgBox "Error finding record: " & Error$
Rem RetVal = False
Rem Resume Next
Rem MsgBox Error$
Rem Resume Exit_Button197_Click
Exit_Button197_Click:
Exit Sub
End Sub