function executes but no results

S

stevenat10

I have an excel sheet that I pull into Access as a table. In order to make
the fields disctinct, I created an AddCounter function that numbers the
fields so I can then delete the duplicate records. All works fine as long as
I execute the code in the immediate window. When I try to run it through a
macro, it seems to execute, but doesn't add the new field "Num". I named the
module "AddCounter()" and in the macro I used "RunCode" and the expression
builder to make sure I didn't misspell or to add the arguments (table name
and new filed name). Not sure why it won't add the new field?
 
K

Ken Snell \(MVP\)

You cannot add a field when importing an EXCEL spreadsheet via
TransferSpreadsheet action (I assume this is how you import the EXCEL
information?). What you do is import the spreadsheet's data into a temporary
table, then use an append query to copy the data to the permanent table --
and put this extra field Num in the append query's field list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top