D
Dave
Access 2003
Excel 2003
Trying to pull in specific field values from Excel into a table in Access.
Copied code form another project we got working before but am clearly
missing something and I believe it is a simple syntax error
to try to keep the amount of code I bore you all with here are the important
lines (I hope)
cmd.CommandText = "Insert into tblCapabilities (EmployeeID) Values
(@EmployeeID)"
cmd.Parameters.Append cmd.CreateParameter("@EmployeeID", adVarChar,
adParamInput, 7)
sht.Cells.Range("A2").Activate
cmd.Parameters("@EmployeeID").Value = xl.ActiveCell
cmd.Execute
Problem is I am not writing to the table
I have cut down my attempt to 1 field until I find the problem
If I step thru it does grab the correct value from Excel
But never writes to the Table.
The field in question is a Number field in both Excel and the Access Table
and is not a primary key (nor does the table currently have a primary key)
I think I have an error in my INSERT line
Any help here will be appreciated.
Thanks in advance
dave
Excel 2003
Trying to pull in specific field values from Excel into a table in Access.
Copied code form another project we got working before but am clearly
missing something and I believe it is a simple syntax error
to try to keep the amount of code I bore you all with here are the important
lines (I hope)
cmd.CommandText = "Insert into tblCapabilities (EmployeeID) Values
(@EmployeeID)"
cmd.Parameters.Append cmd.CreateParameter("@EmployeeID", adVarChar,
adParamInput, 7)
sht.Cells.Range("A2").Activate
cmd.Parameters("@EmployeeID").Value = xl.ActiveCell
cmd.Execute
Problem is I am not writing to the table
I have cut down my attempt to 1 field until I find the problem
If I step thru it does grab the correct value from Excel
But never writes to the Table.
The field in question is a Number field in both Excel and the Access Table
and is not a primary key (nor does the table currently have a primary key)
I think I have an error in my INSERT line
Any help here will be appreciated.
Thanks in advance
dave