query syntax problem

  • Thread starter Thread starter WStoreyII
  • Start date Start date
W

WStoreyII

I have a DataView with the row filters set to

Payee = 'Item'

where item is the value of the current cell clicked in a sort
tree that i have

the problem is the ' character
for instance if the value of the cell is Macy's

when the computer reads the command it reads

Payee = 'Macy's'
and i get a missing operand after the s error

how can i fix this with out making it so that the user can not enter '
charecters in there values?

WStoreyII
 
I have a DataView with the row filters set to

Payee = 'Item'

where item is the value of the current cell clicked in a sort
tree that i have

the problem is the ' character
for instance if the value of the cell is Macy's

when the computer reads the command it reads

Payee = 'Macy's'
and i get a missing operand after the s error

how can i fix this with out making it so that the user can not enter '
charecters in there values?

WStoreyII

You need to escape the quotes - basically you need to double them up.

Payee = Payee.Replace("'"c, "''")
 
Back
Top