I have this code that does what I want it to do. However, I want to take it a step further and have it search within the "AFLastName" field for a match as well. How can I modify this code to search both the "AMLastName" and "AFLastName" fields?
Private Sub AMLastName_Exit(Cancel As Integer)
If DLookup("AMLastName", "DatabaseAdoptiveParent", "AMLastName='" & AMLastName.Value & "'") = Me.AMLastName.Value Then
Duplicate.RowSource = "SELECT APIDName FROM DatabaseAdoptiveParent WHERE AMLastName='" & Me!AMLastName & "'"
End If
End Sub
Private Sub AMLastName_Exit(Cancel As Integer)
If DLookup("AMLastName", "DatabaseAdoptiveParent", "AMLastName='" & AMLastName.Value & "'") = Me.AMLastName.Value Then
Duplicate.RowSource = "SELECT APIDName FROM DatabaseAdoptiveParent WHERE AMLastName='" & Me!AMLastName & "'"
End If
End Sub