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 / December 2005

Tip: Looking for answers? Try searching our database.

Passing a date variable to import file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
margo430 - 28 Dec 2005 19:57 GMT
Hi, I'm new to ms access 2000 and require help.  I have three files -
A,B,C which are produced daily;  each of these files have a date in the
name - meaning file A is A-12152005.txt; B-12152005.txt and
C-12152005.txt.  I would like to create a macro that would import these
three files once a day and load a table.  Can any one help me?
Steve Schapel - 29 Dec 2005 00:34 GMT
Margo,

Use 3 TransferText actions in your macro, one for each of the 3 files.
In the File Name argument, you can do like this for example...
 ="C:\YourFolder\A-" & Format(Date(),"mmddyyyy" & ".txt"

Signature

Steve Schapel, Microsoft Access MVP

> Hi, I'm new to ms access 2000 and require help.  I have three files -
> A,B,C which are produced daily;  each of these files have a date in the
> name - meaning file A is A-12152005.txt; B-12152005.txt and
> C-12152005.txt.  I would like to create a macro that would import these
> three files once a day and load a table.  Can any one help me?
margo430 - 29 Dec 2005 13:54 GMT
Steve, thank you.  I've tried your suggestion but was not successful.
I've removed '=' since it would not work with them.  Now I get an error
which stated 'data set needs to be a  TXT'  etc.  I've put a closing
), but that still didn't work.
KARL DEWEY - 29 Dec 2005 18:38 GMT
Include closing parenthesis  --
 ="C:\YourFolder\A-" & Format(Date(),"mmddyyyy") & ".txt"
-- OR --
 ="C:\YourFolder\A-" & Str(Format(Date(),"mmddyyyy")) & ".txt"

> Steve, thank you.  I've tried your suggestion but was not successful.
> I've removed '=' since it would not work with them.  Now I get an error
>  which stated 'data set needs to be a  TXT'  etc.  I've put a closing
> ), but that still didn't work.
Steve Schapel - 29 Dec 2005 19:10 GMT
Margo,

I apologise for the typo in my post.  As you have detected, I missed out
a ) and the expression should ber like this...
  ="C:\YourFolder\A-" & Format(Date(),"mmddyyyy") & ".txt"
Does this work?  If not, can you post back with a copy/paste of the
exact expression you have used, and also what actually happens, e.g.
error message.

Signature

Steve Schapel, Microsoft Access MVP

> Steve, thank you.  I've tried your suggestion but was not successful.
> I've removed '=' since it would not work with them.  Now I get an error
>  which stated 'data set needs to be a  TXT'  etc.  I've put a closing
> ), but that still didn't work.
 
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.