trying to add 38 values using vba into a table. i'm ok with 1 value, but any more, and i get the error message ''number of query values and destination fields are not the same"
I think the first field in the table is causing it, its an Autonumber
Code: Select all
strSql = "INSERT INTO STI_Table_Main ( raiser ) Values (" & Chr(34) & myname & Chr(34) & ","
strSql = strSql & Chr(34) & raisedate & Chr(34)
strSql = strSql & ");"
CurrentDb.Execute strSql, dbFailOnError
I tried using the 1st field i want the data to start from (raiser), in the above, but that didn't seem to work. I'm presuming its the Autonumber field in the above, which is causing the error.
how can i add 38 fields, but let the autonumber do its job properly.
----------------------------------------------------------------------------------------
Owing at LEAST 34 beers to other helpful forum members. Especially HansV!