Including the Current Date in the File Import / Export Title

D

dbain30

I have a query to import and export a file into Excel. It is received
each day with the name of the file and the current date in the title
and it also needs to be exported in the same fashion. Is there an easy
way to include this in the programming?

For example, the file for today is listed on the shared drive as
"Customer File 101906.xls" and tomorrow it will be "Customer File
102006.xls" and I'd like to have Access recognize this and
systematically import the data without having to do so manually because
of the date issue.

At the same time, I'd like to export the file as "Customer Information
101906.xls" out of Access without having to type that in myself.

Thanks in advance for any help that you can provide!
 
J

Jeff Boyce

If you are using a query for this, add a new field, something like:

YourNewField: Date()

This will add the system's current date as a field in the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

dbain30

Jeff said:
If you are using a query for this, add a new field, something like:

YourNewField: Date()

This will add the system's current date as a field in the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maybe I didn't state the issue properly. I know that I can get the
date in the query, my issue is getting it to be automatically included
in the file name that it is being imported from and exported to.
 
J

Jeff Boyce

How are you with code? To use the Date() function to add the system's
current date to a filename when you import/export, you'll need to be working
in VBA. Check the DoCmd. function, ?Transfer-related syntax.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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