G
Guest
I need to INSERT INTO a table with 19 columns. To simplify the code, I do
not list the columns after the table name, which means I have to define all
19 variables. (My form has only 16 of them, so I define the others as Null.)
Here is how I thought it would work. But Access crashes on Execute, saying
it expects 19 variables. I don't see why it fails.
Dim v1, v2, v3, v4..., v19 As String
v1 = Me.NewANDI
v2 = Me.NewName
v3 = Me.NewAlphaL
v4 = Me.NewAlphaF
....
v19 = Me.NewManAddr
strSQL = "INSERT INTO DonorTbl VALUES (v1, v2, v3, v4..., v19)"
CurrentDb.Execute strSQL, dbFailOnError
Thanks in advance.
not list the columns after the table name, which means I have to define all
19 variables. (My form has only 16 of them, so I define the others as Null.)
Here is how I thought it would work. But Access crashes on Execute, saying
it expects 19 variables. I don't see why it fails.
Dim v1, v2, v3, v4..., v19 As String
v1 = Me.NewANDI
v2 = Me.NewName
v3 = Me.NewAlphaL
v4 = Me.NewAlphaF
....
v19 = Me.NewManAddr
strSQL = "INSERT INTO DonorTbl VALUES (v1, v2, v3, v4..., v19)"
CurrentDb.Execute strSQL, dbFailOnError
Thanks in advance.