S
Strow
Below is my serach button, the problem I am ahaving is that the string
for but the name and/or phone number has to be exact?? is there some
sort of like statement ahere i can type in just part of a name and
phone and get multiple records??? thanks
John
Private Sub cmdSearch_Click()
Dim strSearch As String
Dim strReportName As String
Dim strCriteria As String
strSearch = ""
If Nz(Me.txtfNameSeach, "") <> "" Then
strSearch = "name = '" & Me.txtfNameSeach & "'"
End If
If Nz(Me.txtphoneSeach, "") <> "" Then
If strSearch <> "" Then
strSearch = strSearch & " AND "
End If
strSearch = strSearch & "Telephone = '" & Me.txtphoneSeach & "'"
End If
If strSearch <> "" Then
DoCmd.OpenForm "All", , , strSearch
DoEvents
If Forms!All.Recordset.EOF Then
MsgBox "No Records Found"
Forms!All.FilterOn = False
End If
Else
DoCmd.Close acForm, "Find"
End If
End Sub
for but the name and/or phone number has to be exact?? is there some
sort of like statement ahere i can type in just part of a name and
phone and get multiple records??? thanks
John
Private Sub cmdSearch_Click()
Dim strSearch As String
Dim strReportName As String
Dim strCriteria As String
strSearch = ""
If Nz(Me.txtfNameSeach, "") <> "" Then
strSearch = "name = '" & Me.txtfNameSeach & "'"
End If
If Nz(Me.txtphoneSeach, "") <> "" Then
If strSearch <> "" Then
strSearch = strSearch & " AND "
End If
strSearch = strSearch & "Telephone = '" & Me.txtphoneSeach & "'"
End If
If strSearch <> "" Then
DoCmd.OpenForm "All", , , strSearch
DoEvents
If Forms!All.Recordset.EOF Then
MsgBox "No Records Found"
Forms!All.FilterOn = False
End If
Else
DoCmd.Close acForm, "Find"
End If
End Sub