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:
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]LW1[/TD]
[TD]LW2[/TD]
[TD]LW3[/TD]
[TD]LD1[/TD]
[TD]LD2[/TD]
[TD]LD3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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:
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]LW1[/TD]
[TD]LW2[/TD]
[TD]LW3[/TD]
[TD]LD1[/TD]
[TD]LD2[/TD]
[TD]LD3[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any ide where I go wrong?
Best Regards
MarksuMD