BofRossClan
Technical User
I have a form that I use to lookup products. I have a combo box and the following code:
This code works GREAT! Unless the manufacturer name has an apostrophe. Then I get run-time error 3075. Syntax error. The code thinks the apostrophe in the variable is the end of my code. I have no control over the way the manuf name is entered, as I copy it from a different database that is not mine. Is there any way to code around this problem?
Code:
strManuf = "'" & Me![cmbManufacturer] & "'"
FilterOpt = Me!optFilterOpt
Select Case FilterOpt
Case 1
Me.Filter = "[Manufacturer] like " & strManuf
Me.FilterOn = True
etc.
This code works GREAT! Unless the manufacturer name has an apostrophe. Then I get run-time error 3075. Syntax error. The code thinks the apostrophe in the variable is the end of my code. I have no control over the way the manuf name is entered, as I copy it from a different database that is not mine. Is there any way to code around this problem?