Access 2000 wont accept apostrophe

Madison123

Registered User.
Local time
Yesterday, 18:46
Joined
Dec 16, 2010
Messages
10
I have an insert statement that allows all my information be saved into a table. The only issues is that it will not take an apostrophe. so when i enter O'Donovan or anything like that it crashes.

Can anyone help me?

Code:
CurrentDb.Execute ("INSERT INTO TRCTable (SFDCLeadNumber,TRCSNNumber,TRCName,CAName,Comments,SerialNumber2,SerialNumber3,SerialNumber4,SerialNumber5,SerialNumber6,DateModified) VALUES ('" & Lead1.Value & "','" & TRC1.Value & "','" & TRCName1.Value & "','" & CAName1.Value & "','" & Comments1.Value & "','" & SN2.Value & "','" & SN3.Value & "','" & SN4.Value & "','" & SN5.Value & "','" & SN6.Value & "','" & DateModified.Value & "')")
 
You will have to replace all your " double quotes in the syntax with Chr(34) the ASCII equivelant. Also Numbers do not need these and dates need # hash keys around them
 
Thank you!! That worked perfectly :)
 

Users who are viewing this thread

Back
Top Bottom