run-time error 3075 syntac error (missing operator)

M

mgworek

I don't get it. I am inserting data into a sql database. There are two
text boxes and two drop down boxes. that data then gets inserted into
the db.

One of the drop downs is a list of ticket prioritys. For some reason
my code fails on some of the choices and i have no idea why. Length of
the choice is not the issue. I dont know why it works on most of the
choices but fails on some of them.

Code:

strSQL = "INSERT INTO [database] ([TICKET STATUS], [STORE NUMBER],
[DATE TICKET OPEN], [TIME TICKET OPEN], [HANDLED BY], [DEALER NUMBER
SENT TO SITE], [DESCRIPTION OF PROBLEM], [DESCRIPTION OF WORK DONE],
[TICKET PRIORITY], [TECH], [Status]) " _
& "VALUES ('OPEN', '" & StoreNumber & "', '" & DATE & "', '" & Time &
"', '" & CurrentUser & "', '38', '" & Me.[DESCRIPTION OF PROBLEM] &
"', '" & Me.[DESCRIPTION OF WORK DONE] & "', '" & Me.[TICKET PRIORITY]
& "', '" & Me.[TECH] & "', '1')"
CurrentDb.Execute (strSQL)
MsgBox "New Service Ticket Has Been Opened for " & Me.StoreNumber

TICKET PRIORITY is where the problem happens. Example:

If I select the choice: 1 - Can't Retrieve Voice Messages
Everything works fine
If I select the choice: 1 - Can't Scan Bar Codes I
get the runtime error.

What am I missing?
 

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

Top