chestera
asked on
Like search using chr(34)
Hi EE
I am having problems with a like search using chr(34)
Here is my code
Search = "SELECT * FROM tblCustomer WHERE [SurName] = " & Chr(34) & Me!txtSurname & Chr(34)
I want to change to a like search. I have tried
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like " * [" & Chr(34) & "] * " & Me!txtSurname & Chr(34)"
Any help appreciated
I need to use chr(34) because we have a lot of O'Brians etc
chestera
I am having problems with a like search using chr(34)
Here is my code
Search = "SELECT * FROM tblCustomer WHERE [SurName] = " & Chr(34) & Me!txtSurname & Chr(34)
I want to change to a like search. I have tried
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like " * [" & Chr(34) & "] * " & Me!txtSurname & Chr(34)"
Any help appreciated
I need to use chr(34) because we have a lot of O'Brians etc
chestera
ASKER
MacroShadow
I tried
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like * " & Chr(39) & " * " & Me!txtSurname
Get message missing operator, should there be something after me!txtsurname
Alan
I tried
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like * " & Chr(39) & " * " & Me!txtSurname
Get message missing operator, should there be something after me!txtsurname
Alan
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Macroshadow
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like " & Chr(34) & Me!txtSurname & Chr(39) & "*" & Chr(34)
The above wont find any surname. I have for example I entered Jones which is a current surbname it didn't find it.
Alan
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like " & Chr(34) & Me!txtSurname & Chr(39) & "*" & Chr(34)
The above wont find any surname. I have for example I entered Jones which is a current surbname it didn't find it.
Alan
ASKER
IrogSinta
Enter both
Search = "SELECT * FROM tblCustomer WHERE [SurName] LIKE " & Chr(34) & Me!txtSurname & Chr(34)
Search = "SELECT * FROM tblCustomer WHERE [SurName] LIKE """ & Me!txtSurname & """"
for example I searched for Jones and it finds all jones but if I enter Jon no luck
Your help is appreciated
Alan
Enter both
Search = "SELECT * FROM tblCustomer WHERE [SurName] LIKE " & Chr(34) & Me!txtSurname & Chr(34)
Search = "SELECT * FROM tblCustomer WHERE [SurName] LIKE """ & Me!txtSurname & """"
for example I searched for Jones and it finds all jones but if I enter Jon no luck
Your help is appreciated
Alan
ASKER
Guy Hengel
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like " & Chr(39) & "*" & Me!txtSurname & "*" & chr(39)
It will find full name but not a partial name
Alan
Search = "SELECT * FROM tblCustomer WHERE [SurName] Like " & Chr(39) & "*" & Me!txtSurname & "*" & chr(39)
It will find full name but not a partial name
Alan
ASKER
Macroshadow
My Apologies. I must have a bug in the form I was using your code, I used another form an it worked.
I am going to ward point to all three in fairness. You was first so you get best solution.
Alan
My Apologies. I must have a bug in the form I was using your code, I used another form an it worked.
I am going to ward point to all three in fairness. You was first so you get best solution.
Alan
ASKER
IrogSinta
My Apologies. I must have a bug in the form I was using your code, I used another form an it worked.
I am going to ward point to all three in fairness
Alan
My Apologies. I must have a bug in the form I was using your code, I used another form an it worked.
I am going to ward point to all three in fairness
Alan
ASKER
Guy Hengel
My Apologies. I must have a bug in the form I was using your code, I used another form an it worked.
I am going to ward point to all three in fairness. Alan
My Apologies. I must have a bug in the form I was using your code, I used another form an it worked.
I am going to ward point to all three in fairness. Alan
Open in new window