If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Syntax Error in INSERT

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-04-12, 14:55
KWHAT KWHAT is offline
Registered User
 
Join Date: Dec 2011
Posts: 35
Syntax Error in INSERT

Code:
    CurrentDb.Execute "INSERT INTO Totals (TYPE,SUNDAY,MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY, [HG_ID], TIME) VALUES ('GENERAL'," & G_SunTXT.Value & " , " & G_MonTXT.Value & ", " & G_TueTXT.Value & ", " & G_WedTXT.Value & ",  " & G_ThuTXT.Value & ", " & G_FriTXT.Value & ", " & G_SatTXT.Value & ", " & HG_ID & ", '" & Me.TimeLST.Value & "');"
This gives me a syntax error
TYPE and TIME are text, and all other fields are numbers, so what am I doing wrong?
Reply With Quote
  #2 (permalink)  
Old 01-04-12, 18:45
pbaldy pbaldy is offline
Registered User
 
Join Date: May 2005
Location: Nevada, USA
Posts: 2,475
See if this helps:

Debugging

Also, you may need to bracket Time and Type, as both are reserved words.
__________________
Paul
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On