kieranplatt1
Programmer
Hi, hope someone can help. I am trying to open a form to display certain records i.e. users type in a surname or part of a surname into a field 'goto' - I want the form to display all records where either 'surname1' OR 'surname2' (these are Mr & Mrs records which could have couples with differing surnames) begin with the letters input into 'goto'. I am trying to use wildcard - this is the code I have tried...
Private Sub Command111_Click()
On Error GoTo MyError
DoCmd.OpenForm "ClientsTab", , , "[Surname1] = '" & Me![goto] & "*'" or [Surname2] = '" & Me![goto] & "*'"
Exit Sub
MyError:
MsgBox (Err.Number & "-" & Err.Description)
End Sub
any offers!? Thanks, Kieran.
Private Sub Command111_Click()
On Error GoTo MyError
DoCmd.OpenForm "ClientsTab", , , "[Surname1] = '" & Me![goto] & "*'" or [Surname2] = '" & Me![goto] & "*'"
Exit Sub
MyError:
MsgBox (Err.Number & "-" & Err.Description)
End Sub
any offers!? Thanks, Kieran.