Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable interferring with SQL 1

Status
Not open for further replies.

markvan

Technical User
Sep 12, 2001
37
0
0
AU
I am attempting to update the notes field of my Orders table with a new note.
The newnote variable has the existing notes and the new note appended at the bottom and can be a few pages long.

When I attempt to run the SQL
Code:
SQL = "UPDATE Orders " & "SET Orders.notes = " & newnote & "WHERE Orders.OrderID = " & recordID

I get a Runtime error 3075 saying syntax error missing operator in query expression: And then the contents of the newnote variable displayed.

How do I encapsulate the content of my newnote variable so that it is updated into the field and not interpretted as part of the SQL command.

Mark Van Laarhoven
Dot Imaging Online Printers, Sydney, Australia.
 


Hi

This should really be posted in VBA Visual Basic for Applications (Microsoft) forum707
Code:
SQL = "UPDATE Orders SET Orders.notes = '" & newnote & "' WHERE Orders.OrderID = " & recordID
TICS around String Values. I assume the OrderID is NUMERIC. Otherwise that variable need TICS as well.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 


I'm Sorry regarding the remark about where this should have been posted.

This forum is the correct one.

And thanks for the recognition.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top