My Assistant
![]() ![]() |
|
|
May 5 2012, 02:16 AM
Post
#1
|
|
|
UtterAccess Veteran Posts: 324 |
how to handle inserting a string with an apostrophe? i just realized this is actually a problem for me because some names have an apostrophe.
right now this is my value field in the insert: '" & Me.txtlastname & "' how to properly quote it to be able to insert a quotation or apostrophe properly? |
|
|
|
May 5 2012, 02:49 AM
Post
#2
|
|
|
UtterAccess Guru Posts: 857 From: Bogotá - Colombia |
You can use Chr(34) (") instead of (').
Regards, Diego |
|
|
|
May 5 2012, 06:44 AM
Post
#3
|
|
|
Utter A-fishin'-ado Posts: 17,723 From: Cincinnati, Ohio, USA . . . ><((((°> |
You'll need to double any existing quotes, so a RELPACE() function is needed.
If you are using VBA, something like: CODE '" & Replace(Me.txtlastname, "'", "''") & "' |
|
|
|
May 5 2012, 10:18 AM
Post
#4
|
|
|
UtterAccess Veteran Posts: 324 |
worked like a charm, perfect.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 08:23 AM |