chr(34) didn't give correct result

G

Gabriel

In my VB code I use chr(34) to create a double quote in my filter criteria as follows

Me.Filter = "Field_Name = " & chr(34) & txtFieldName & chr(34

In some client pc it works fine, but in others it failed since their system translate this chr(34) expression as "|" character not as double quote character

Any ideas to handle this error very appreciate

Gabriel
 
G

Graham R Seach

Gabriel,

Just use three quotes on the left side, and four on the right side:
Me.Filter = "Field_Name = """ & Me.txtFieldName 7 """"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


Gabriel said:
In my VB code I use chr(34) to create a double quote in my filter criteria as follows :

Me.Filter = "Field_Name = " & chr(34) & txtFieldName & chr(34)

In some client pc it works fine, but in others it failed since their
system translate this chr(34) expression as "|" character not as double
quote character.
 
G

Gabriel

Thanks

It works now ....

----- Graham R Seach wrote: ----

Gabriel

Just use three quotes on the left side, and four on the right side
Me.Filter = "Field_Name = """ & Me.txtFieldName 7 """

Regards
Graham R Seac
Microsoft Access MV
Sydney, Australi

Microsoft Access 2003 VBA Programmer's Referenc
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.htm


Gabriel said:
In my VB code I use chr(34) to create a double quote in my filter criteri as follows
system translate this chr(34) expression as "|" character not as doubl
quote character
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top