Importing a file name

  • Thread starter angelinarose via AccessMonster.com
  • Start date
A

angelinarose via AccessMonster.com

Hi Folks,
I current have a database set up to look up file name of an excel spreadsheet
and import it into the database. Each day we receive a excel spreadsheet with
blah20080416.xls
The importing of the file works fine but I was wondering if there is a way to
capture the date out of the file name and place it into each record that is
import from the spreadsheet?


any help would be greatly appreciated
thanks!
 
J

Jeanette Cunningham

angelinarose,
In your code, you can save the name of the workbook as a string variable
called strTheFileName.
strPartFileName = Left$(strTheFileName, Len(strTheFileName) -4) will give
the file name without the .xls on the end.
Right$(strPartFileName, 8) will give you the date as 20080416.
You can run an update query to set the date field to 20080416.


Jeanette Cunningham
 

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