I placed a combo box named CboSearchItem on form to select and bring the record onto the form. Its working smoothly.
Set rst1 = CurrentDb.OpenRecordset("Select * From Product_Master " & _
"where Productname= " & """" & CboSearchItem & """")
But when data in field 'ProductName' contains " mark, it produces error 3075 :
Syntax error in string in query expression "ProductName = "Hose White 3/4"'"
When I replaced all " mark from the data / record, it works fine.
For example Product Name are as follows:
Elbow 2 Way
ABC Pipe 3"
Shower Pipe 1 1/5 Meter
Reading all the above record but not the second one because it contains " mark.
I can not tell my client not to use " symbol while entering the product name. There should be a solution.
Please extend your help.
With kind regards,
Ashfaque
Set rst1 = CurrentDb.OpenRecordset("Select * From Product_Master " & _
"where Productname= " & """" & CboSearchItem & """")
But when data in field 'ProductName' contains " mark, it produces error 3075 :
Syntax error in string in query expression "ProductName = "Hose White 3/4"'"
When I replaced all " mark from the data / record, it works fine.
For example Product Name are as follows:
Elbow 2 Way
ABC Pipe 3"
Shower Pipe 1 1/5 Meter
Reading all the above record but not the second one because it contains " mark.
I can not tell my client not to use " symbol while entering the product name. There should be a solution.
Please extend your help.
With kind regards,
Ashfaque
Attachments
Last edited: