-1

I'm writing in VBA / MS Access and i got an error again for "Run-time Error : 3129" at INSERT INTO statement.

I tried a ";" at the end but it's still not working...

 isq = "INSERT INTO" & kaptab & "( Projekt_ID, Projekt_Root, Projektnummer, GJ_ID, MA_ID, MA_StdSatzGr, MA_StdSatz," & _
     "Auftragskennzeichen, Prozentverteilung, MonatStd1, MonatStd2, MonatStd3, MonatStd4, MonatStd5," & _
     ", MonatStd6, MonatStd7, MonatStd8, MonatStd9, MonatStd10, MonatStd11, MonatStd12, Bearbeiter, Datum)," & _
     "VALUES('" & PID & "', '" & prt & "', '" & prn & "', '" & gid & "', '" & mid & "', '" & stg & "', " & sts & "', '" & _
      akz & "', '" & prz & "', '" & ms1 & "', '" & ms2 & "', '" & ms3 & "', '" & ms4 & "', '" & ms5 & "', '" & _
      ms6 & "', '" & ms7 & "', '" & ms8 & "', '" & ms9 & "', '" & ms10 & "', '" & ms11 & "', '" & ms12 & "', '" & _
      bab & "', '" & dab & "');"

DoCmd.RunSQL isq

What is the Problem please???

Nao93
  • 1
  • 1
  • 1
    do debug.print xsq before docmd.runsql and see if the sql is a valid sql. either paste in your query designer. – Krish Nov 23 '17 at 18:48
  • You think all variables are text. They are not. – Gustav Nov 23 '17 at 20:11
  • Possible duplicate of [Syntax error in insert into statement - what's the error?](https://stackoverflow.com/questions/43589800/syntax-error-in-insert-into-statement-whats-the-error) – Gustav Nov 23 '17 at 22:14

1 Answers1

0

Remove the comma just before the WHERE

Tim Williams
  • 154,628
  • 8
  • 97
  • 125