How to disable @ parsing?

S

Stephan_Cz

Hi there,

when using MyForm.recordsource="SELECT * FROM products WHERE
prodcode='Screws@8' "

I get a message box asking for "Input parameter value 8". How can I disable
the parsing of the @ symbol to allow searching for fields with the embedded @
symbol?

Any idea would help

Stephan
 
K

kingston via AccessMonster.com

Have you tried putting the @ symbol in brackets?
prodcode='Screws[@]8'
You'll have to check fo the @ symbol before you formulate the string:
If InStr([Field],"@")>0 then...
Replace([Field],"@","[@]")
 
S

Stephan_Cz via AccessMonster.com

Hi kingston

yes, I've tried brackets, yet it does not help. Instead the right bracket
becomes part of the question:

Input parameter value ]8

Cheers

Stephan
 
K

kingston via AccessMonster.com

Try creating a string variable:

strVar = "Screws@8"

Then create the SQL string:

"SELECT * FROM products WHERE prodcode='" & strVar & "'"


Stephan_Cz said:
Hi kingston

yes, I've tried brackets, yet it does not help. Instead the right bracket
becomes part of the question:

Input parameter value ]8

Cheers

Stephan
 
D

Dirk Goldgar

Stephan_Cz said:
Hi there,

when using MyForm.recordsource="SELECT * FROM products WHERE
prodcode='Screws@8' "

I get a message box asking for "Input parameter value 8". How can I
disable the parsing of the @ symbol to allow searching for fields
with the embedded @ symbol?

I'm guessing this is an ADP problem, and I don't have one handy to test.
But would it work if you wrote this:

MyForm.recordsource = _
"SELECT * FROM products WHERE prodcode='Screws'+'@'+'8' "

?
 
Top