By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

SQL Insert question

P: n/a
I got a syntax error in SQL insert into statement , hope someone can
help me .Thanks.

job_search = "[job_order]='" & Me.Jobno & "' "
sqlstr = "INSERT INTO Custorder (job_order) " & _
"values " & (job_search) & ";"

Regards,
Daniel
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The right syntax should be something like:
INSERT INTO Custorder (job_order) VALUES (123)
or, in case of alfanumeric values:
INSERT INTO Custorder (job_order) VALUES ('abc')

so your code should be something like:

sqlstr = "INSERT INTO Custorder (job_order) VALUES (" & Jobno & ");"
or
sqlstr = "INSERT INTO Custorder (job_order) VALUES ('" & Jobno & "');"

hope this helps....

"Daniel Tan" <da*******@time.net.my> wrote in message
news:6a*************************@posting.google.co m...
I got a syntax error in SQL insert into statement , hope someone can
help me .Thanks.

job_search = "[job_order]='" & Me.Jobno & "' "
sqlstr = "INSERT INTO Custorder (job_order) " & _
"values " & (job_search) & ";"

Regards,
Daniel

Nov 12 '05 #2

P: n/a
Hi, still got syntax error, missing operator. "[job_order]='xxx'"

Rgds,
Daniel

"KeejToe" <bi******@hotmail.com> wrote in message news:<ci*********************@phobos.telenet-ops.be>...
The right syntax should be something like:
INSERT INTO Custorder (job_order) VALUES (123)
or, in case of alfanumeric values:
INSERT INTO Custorder (job_order) VALUES ('abc')

so your code should be something like:

sqlstr = "INSERT INTO Custorder (job_order) VALUES (" & Jobno & ");"
or
sqlstr = "INSERT INTO Custorder (job_order) VALUES ('" & Jobno & "');"

hope this helps....

"Daniel Tan" <da*******@time.net.my> wrote in message
news:6a*************************@posting.google.co m...
I got a syntax error in SQL insert into statement , hope someone can
help me .Thanks.

job_search = "[job_order]='" & Me.Jobno & "' "
sqlstr = "INSERT INTO Custorder (job_order) " & _
"values " & (job_search) & ";"

Regards,
Daniel

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.