Hello Everyone;
I have a form which the user enters a person's name, then uses a button to call the following code. It works, but I also want to add an "OR" and nothing I do works.
Or "tblPeople WHERE Soundex((Nz[Spouse_CommonLaw_Last_Name])= '" & Soundex(Me.txtLastName) & " '"))
Original code without the above OR statement:
Private Sub CheckNames_Click()
Dim varID As Variant
Dim rst As DAO.Recordset, strNames As String
FROM tblPeople
If Not IsNothing(Me.txtLastName) Then
Set rst = DBEngine(0)(0).OpenRecordset("SELECT Last_Name, Spouse_CommonLaw_Last_Name, Spouse_Commonlaw_First_Name, Home_Phone_No FROM " & _
"tblPeople WHERE(Soundex([Last_Name]))= '" & Soundex(Me.txtLastName) & "'")
Any help would be appreciated.
Thanks, Sophia