Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2011
    Posts
    35

    Unanswered: 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?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    See if this helps:

    Debugging

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •