sql update of text field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.....
 
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
 
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 & "')"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top