Date in file name

F

ftrujill0

I have a daily file that I need to import into access that uses the date and
file name (i.e. 02252008_report.csv) and was wondering if there is a way to
set up a macro that will use the current date and report name to import the
file into access?

I thought maybe using the transfer action and in the file name field trying
to use the following type of code but keep getting an error.

In the file name box:
c:\temp\format(date(), "mmddyyyy")&'report'.csv

thanks in advance!
 
S

Steve Schapel

Ftrujill0,

The syntax of your expression is incorrect, in a number of ways. Try
like this:

="C:\temp\" & Format(Date(),"mmddyyyy") & "_report.csv"
 
F

ftrujill0

you rock Steve!!! Thank you.

Steve Schapel said:
Ftrujill0,

The syntax of your expression is incorrect, in a number of ways. Try
like this:

="C:\temp\" & Format(Date(),"mmddyyyy") & "_report.csv"
 
A

Agor

if there any way to use this to output a file from Access to Excel?

I'm am trying to automatically add todays date to file name of Access Table
that is exported into excel.

I tried using the syntax formula you supplied using both the Transfer and
Output to functions in Macro but they dont work.

(="C:\AccessReports\" & Format(Date(),"ddmmyyyy") & "_report.xls")

I tells me I have a syntax error in the visual basic module
I'm using Access 2002

thanks
 

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