function executes but no results

  • Thread starter Thread starter stevenat10
  • Start date Start date
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?
 
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.
 
Back
Top