How to Append Table with file and add a field with file name

M

Mary

I am appending an Excel Sheet to a table in Access. There are many files to
Import in and I would like the file name to go into a field of each record
appending in because the file name contains a date. I need this date to
reference the detail of the record. How do I get an import script that adds
the file name to that field in each record being appended in?
 
P

PieterLinden via AccessMonster.com

Mary said:
I am appending an Excel Sheet to a table in Access. There are many files to
Import in and I would like the file name to go into a field of each record
appending in because the file name contains a date. I need this date to
reference the detail of the record. How do I get an import script that adds
the file name to that field in each record being appended in?

How are you doing the import? If you're using TransferSpreadsheet, then you
might have to update the table with the filename after the import. If you're
using an append query, you could create a function that returned the name of
the Excel file and then use that in your query...
 
P

PieterLinden via AccessMonster.com

Mary said:
I am appending an Excel Sheet to a table in Access. There are many files to
Import in and I would like the file name to go into a field of each record
appending in because the file name contains a date. I need this date to
reference the detail of the record. How do I get an import script that adds
the file name to that field in each record being appended in?

How are you doing the import? If you're using TransferSpreadsheet, then you
might have to update the table with the filename after the import. If you're
using an append query, you could create a function that returned the name of
the Excel file and then use that in your query...
 

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