What is the correct way to program when filling in grids or text boxes with information that may contain an appostrophe? I have a work around which is just a function:
Dim tmp As String, pos As Integer
Dim i As Integer, char As String
For i = 1 To Len(Targetstring)
char = Mid(Targetstring, i, 1)
tmp = tmp + char
If char = "'" Then tmp = tmp + "'"
Next i
funAppendAppostrophe = tmp
I was wondering if there was a better way to handle this problem. I'm having problems saving data that contains an appostrophe back to a table using results from a recordset. Any suggestions?
Thanks,
Corinne
Dim tmp As String, pos As Integer
Dim i As Integer, char As String
For i = 1 To Len(Targetstring)
char = Mid(Targetstring, i, 1)
tmp = tmp + char
If char = "'" Then tmp = tmp + "'"
Next i
funAppendAppostrophe = tmp
I was wondering if there was a better way to handle this problem. I'm having problems saving data that contains an appostrophe back to a table using results from a recordset. Any suggestions?
Thanks,
Corinne