Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / May 2008

Tip: Looking for answers? Try searching our database.

Date in file name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ftrujill0 - 25 Feb 2008 19:41 GMT
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!
Steve Schapel - 25 Feb 2008 21:33 GMT
Ftrujill0,

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

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

Signature

Steve Schapel, Microsoft Access MVP

> 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
[quoted text clipped - 8 lines]
>
> thanks in advance!
ftrujill0 - 25 Feb 2008 21:57 GMT
you rock Steve!!! Thank you.

> Ftrujill0,
>
[quoted text clipped - 15 lines]
> >
> > thanks in advance!
Agor - 13 Mar 2008 19:43 GMT
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

> Ftrujill0,
>
[quoted text clipped - 15 lines]
> >
> > thanks in advance!
catspajamas - 12 May 2008 21:16 GMT
Use single quotes around the ddmmyyyy instead of double quotes.

> if there any way to use this to output a file from Access to Excel?
>
[quoted text clipped - 30 lines]
> > >
> > > thanks in advance!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.