Dear all
strSQL = "associate_name = '" & Text2.Text & "'"
rst.find strSQL
gives an error bcoz Text2.text contain
JOHN'S CLINIC
It contains an apostrophy.
How to deal with this.
urgent pls
thanx
Printable View
Dear all
strSQL = "associate_name = '" & Text2.Text & "'"
rst.find strSQL
gives an error bcoz Text2.text contain
JOHN'S CLINIC
It contains an apostrophy.
How to deal with this.
urgent pls
thanx
I guess you can add \ before ' so you don't get that error. I'm not sure if it's that character though... I'm no expert with SQL, but this is a little thing I remember from somewhere...
The string would be then JOHN\'S CLINIC
I don't know if this works but try
strSQL = "associate_name = '[" & Text2.Text & "]'"
Martin / Merri
both does not work.
some one urgent pls.
And the value in Text2.text is from the Table.
So do not know how many times apostrophy is there and which place.
Though this can be found out, it will be troublsome.
Any simpler solution for this?
Ok, try to convert it with %27 (which is the character code for ' - I don't know if SQL supports quoted printable coding though... (this is used in the HTML-urls)
Dim strName As String
strName = Replace(Text2.Text, "'", "''")
strSQL = "associate_name = '" & strName & "'"
Its resolved
strFind= Replace(Text2.text, " ' ", " ' ' " )
strSQL = "associate_name = '" & strFind & "'"
rst.find strSQL
ok ok marty
Thankx