Hi guys,
having trubble importing data in to a query.
I want to import all data att the same time to the same row but the code tells me that the number of varibles don't match the number of destinations. (Run-Time ERROR 3346)
What I have is this:
Table looks as follows:
<tbody>
</tbody>
Any ide where I go wrong?
Best Regards
MarksuMD
having trubble importing data in to a query.
I want to import all data att the same time to the same row but the code tells me that the number of varibles don't match the number of destinations. (Run-Time ERROR 3346)
What I have is this:
Code:
sub import()
lastID = DMax("ID", "MTQ1")
LV2 = "70"
LV3 = "69"
LV4 = "71"
LV5 = "25"
LV6 = "26"
LV7 = "25"
' These values are imported from an XML which makes them come out as strings
sqls = "INSERT INTO MTQ1 (ID, LW1, LW2, LW3, LD1, LD2, LD3) VALUES ('" & lastID + 1 & ", " & LV2 & ", " & LV3 & ", " & LV4 & ", " & LV5 & ", " & LV6 & ", " & LV7 & " ') "
Debug.Print sqls
DoCmd.RunSQL sqls
End sub
Table looks as follows:
ID | LW1 | LW2 | LW3 | LD1 | LD2 | LD3 |
1 | ||||||
<tbody>
</tbody>
Any ide where I go wrong?
Best Regards
MarksuMD