chr(34) didn't give correct result

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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
 
Back
Top