INSERT INTO tablename gives error
Posted on 2011-03-05
I have two out of five of my tables in a MS Access database not allowing an INSERT INTO statement. It gives me the error:
The Insert Into statement contains the following unknown field name: CurrMonthName.
My SQL statement goes something like this:
"Insert Into DataTable (CurrMonthName,CurrYear) Values (@CurrMonthName,@CurrYear);
I've tried deleting the table and re-creating it. I removed the CurrMonthName field in the statement so it's just asking for CurrYear, and I still get the same error, except of course it says the unknown field name = CurrYear. I've also tried inserting the data directly from an Append Query in MS Access, and that won't work either.
Any ideas of what I'm doing wrong?