Insert

ManuNeko

Registered User.
Local time
Today, 16:31
Joined
Aug 23, 2006
Messages
31
I have an insert that works perfect just until I have a name with a ' in it. Can anyone tell me how to solve this? I know what causes the problem, but I don't know how to solve it.

I work with Access 2003 and here is the insert statement:


Code:
sInsertStr = "Insert Into Persoon (Naam, Voornaam) Values ("
sInsertStr = sInsertStr & "'" & rsPersoneel![Familienaam] & "','" & rsPersoneel![Voornaam]
sInsertStr = sInsertStr & ")"
 
Double up the quotes around fields with suspected single qoutes

ex:

""" & [MyField] & """"

or you can wrap the field by using Chr(34)

... & Chr(34) & [MyField] & Chr(34) ...

JR
 
That works, thanks.
 

Users who are viewing this thread

Back
Top Bottom