473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Import dynamically named files using macro

I have a database set-up to do file comparisons. I import the files into
the database and do the comparisons with queries. I have to do this
comparison on a daily basis so I would like to set up a macro to do it. The
problem I have is that the names of the source files that are imported
change everyday. The date is appended to the file name. The format of the
file name is 'filename mm-dd-yyyy.txt'. Is there a way to write a macro to
import files when the name of the source file changes everyday?
Nov 12 '05 #1
3 6902
On Tue, 11 May 2004 10:01:36 -0400, "Jeff Marcum"
<je********@consultant.com> wrote:

Presumably you are using DoCmd.TransferText. The filename argument
could be:
"filename " & Format$(Date,"mm-dd-yyyy") & ".txt"

-Tom.

I have a database set-up to do file comparisons. I import the files into
the database and do the comparisons with queries. I have to do this
comparison on a daily basis so I would like to set up a macro to do it. The
problem I have is that the names of the source files that are imported
change everyday. The date is appended to the file name. The format of the
file name is 'filename mm-dd-yyyy.txt'. Is there a way to write a macro to
import files when the name of the source file changes everyday?


Nov 12 '05 #2
I was trying to do this just using the TransferText action within the Macro.
Can what you are suggesting be applied to that?

"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:4m********************************@4ax.com...
On Tue, 11 May 2004 10:01:36 -0400, "Jeff Marcum"
<je********@consultant.com> wrote:

Presumably you are using DoCmd.TransferText. The filename argument
could be:
"filename " & Format$(Date,"mm-dd-yyyy") & ".txt"

-Tom.

I have a database set-up to do file comparisons. I import the files into
the database and do the comparisons with queries. I have to do this
comparison on a daily basis so I would like to set up a macro to do it. Theproblem I have is that the names of the source files that are imported
change everyday. The date is appended to the file name. The format of thefile name is 'filename mm-dd-yyyy.txt'. Is there a way to write a macro toimport files when the name of the source file changes everyday?

Nov 12 '05 #3
Nevermind - I converted the macro to a Module and used Tom's suggestion. It
works just fine. Thanks

"Jeff Marcum" <je********@consultant.com> wrote in message
news:c7**********@mailgate2.lexis-nexis.com...
I was trying to do this just using the TransferText action within the Macro. Can what you are suggesting be applied to that?

"Tom van Stiphout" <to*****@no.spam.cox.net> wrote in message
news:4m********************************@4ax.com...
On Tue, 11 May 2004 10:01:36 -0400, "Jeff Marcum"
<je********@consultant.com> wrote:

Presumably you are using DoCmd.TransferText. The filename argument
could be:
"filename " & Format$(Date,"mm-dd-yyyy") & ".txt"

-Tom.

I have a database set-up to do file comparisons. I import the files intothe database and do the comparisons with queries. I have to do this
comparison on a daily basis so I would like to set up a macro to do it. Theproblem I have is that the names of the source files that are imported
change everyday. The date is appended to the file name. The format of thefile name is 'filename mm-dd-yyyy.txt'. Is there a way to write a
macro
toimport files when the name of the source file changes everyday?


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Irmen de Jong | last post by:
Hello, I don't understand why the following doesn't work. What I want to do is dynamically import some generated Python code and I'm doing this using compile and exec'ing it in the dict of a new...
79
by: pinkfloydhomer | last post by:
I want to scan a file byte for byte for occurences of the the four byte pattern 0x00000100. I've tried with this: # start import sys numChars = 0 startCode = 0 count = 0
1
by: mirandacascade | last post by:
O/S: Windows 2K Vsn of Python: 2.4 Currently: 1) Folder structure: \workarea\ <- ElementTree files reside here \xml\ \dom\
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
3
by: ninrulz | last post by:
I will try to explain my situation. I know that it is hard to offers solutions without fully understanding what people would like to achieve. I receive 2 csv files every month. The csv files...
49
by: Martin Unsal | last post by:
I'm using Python for what is becoming a sizeable project and I'm already running into problems organizing code and importing packages. I feel like the Python package system, in particular the...
2
by: jennise | last post by:
Hello I am using the DoCmd.TransferText to write a macro to import dynamically named file from a filepath. My macro written as follows: Sub TestTransferText() DoCmd.TransferText...
2
DAF LAD
by: DAF LAD | last post by:
Hi. I have been running an access Database in Office 2003 for a while now. When I upgraded to Office 2007 one of my macro buttons has stopped working. The Button looks up to VBA code to Import...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.