sql update of text field

D

dfeigen115

This should be fairly simple, but I'm not seeing the flaw in my code. the
database field is: "planningstatuscomment", the field on the form is
"planningcommenttext" and is unbound. The field content may include special
characters. I've tried variants of:

strsql0 = "UPDATE project SET planningstatuscomment = " &
me.planningcommenttext & " WHERE (project.projectname = '" & Me.ProjectName
& "');"

updates of other non-text fields on the form (dates, checkboxes) are working.

Thanks in advance.....
 
T

TonyT

Have you tried using single quotations ' ' around me.planningcommenttext ie;

strsql0 = "UPDATE project SET planningstatuscomment = '" &
me.planningcommenttext & "' WHERE (project.projectname = '" & Me.ProjectName
& "');"


should allow text and special characters that way, not just numbers.

TonyT
 
D

Douglas J. Steele

Since you're dealing with text, you need to put quotes around the value
you're trying to use for update:

strsql0 = "UPDATE project SET planningstatuscomment = " & Chr$(34) &
me.planningcommenttext & Chr$(34) & " WHERE (project.projectname = '" &
Me.ProjectName & "')"
 
Top