Hello everyone:
I have a form where the user would enter various data known about a person to enable them to find that person's record. The table has a seperate field for three phone numbers....eg. Home_Phone_No, Work_Phone_No and Cell_Phone_No.
Is it possible to enter any of the phone numbers (home, work or cell) on the form in one field, but have it search all three fields of the table to find the person?
Currently, I have it searching only one field of the table, as follows:
Private Sub OK_Click()
Me.Visible = False
Dim strWhere As String
strWhere = "1=1 "
If Not IsNull(Me.txtHomePhoneNumber) Then
strWhere = strWhere & " And [Home_Phone_No]= '" & _
Me.txtHomePhoneNumber & "' "
End If
If Not IsNull(Me.txtWorkPhoneNumber) Then
strWhere = strWhere & " And [Home_Phone_No]= '" & _
Me.txtWorkPhoneNumber & "' "
End If
DoCmd.OpenForm "LkkpPeople", acNormal, , strWhere
End Sub
Any help would be appreciated.
Sophia
I have a form where the user would enter various data known about a person to enable them to find that person's record. The table has a seperate field for three phone numbers....eg. Home_Phone_No, Work_Phone_No and Cell_Phone_No.
Is it possible to enter any of the phone numbers (home, work or cell) on the form in one field, but have it search all three fields of the table to find the person?
Currently, I have it searching only one field of the table, as follows:
Private Sub OK_Click()
Me.Visible = False
Dim strWhere As String
strWhere = "1=1 "
If Not IsNull(Me.txtHomePhoneNumber) Then
strWhere = strWhere & " And [Home_Phone_No]= '" & _
Me.txtHomePhoneNumber & "' "
End If
If Not IsNull(Me.txtWorkPhoneNumber) Then
strWhere = strWhere & " And [Home_Phone_No]= '" & _
Me.txtWorkPhoneNumber & "' "
End If
DoCmd.OpenForm "LkkpPeople", acNormal, , strWhere
End Sub
Any help would be appreciated.
Sophia