473,385 Members | 1,944 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,385 software developers and data experts.

show current date in export txt file name

9
I'm using a macro to transfer a table to txt file, which is fine but I want to run it each day (as the table contents change) and include the date in the filename without having to manually rename each time. It's infuriatingly simple but beyond my beginner's grasp. Can anyone help? I'm using Access 2000.

(I posted this in Articles section by mistake- apologies)
Aug 10 '07 #1
2 3857
missinglinq
3,532 Expert 2GB
As is the case with many of us here, I seldom use macros. To do this in code would be something like this
Expand|Select|Wrap|Line Numbers
  1. TheDate = Month(Date) &"-" & Day(Date) & "-" & Year(Date)
  2. TheFile = CompletePathAndFileName & TheDate & ".txt"
  3. DoCmd.OutputTo acOutputTable, "YourTableName", acFormatTXT, TheFile, False, ""
I think in a macro it would be something like this:
Expand|Select|Wrap|Line Numbers
  1. CompletePathAndFileName & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & ".txt"
Welcome to TheScripts!

Linq ;0)>
Aug 10 '07 #2
Neil99
9
As is the case with many of us here, I seldom use macros. To do this in code would be something like this
Expand|Select|Wrap|Line Numbers
  1. TheDate = Month(Date) &"-" & Day(Date) & "-" & Year(Date)
  2. TheFile = CompletePathAndFileName & TheDate & ".txt"
  3. DoCmd.OutputTo acOutputTable, "YourTableName", acFormatTXT, TheFile, False, ""
I think in a macro it would be something like this:
Expand|Select|Wrap|Line Numbers
  1. CompletePathAndFileName & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & ".txt"
Welcome to TheScripts!

Linq ;0)>

thanks for the welcome Linq (and the answer of course).
I'll give the code a try seems like a good time to start.
Aug 10 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Joshua Ammann | last post by:
Hello, I'm trying to export a query containing contact information, including a field. Some zip codes have one or two leading zeros, for example, San Juan, PR (00927) and Springfield, MA...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
6
by: ninrulz | last post by:
I have created a database that has over 70 queries and over 40k records. I used the OutputTo action to export the queries to Excel. I would like the functionality of adding the date (Month-YY) to...
2
by: mamin | last post by:
I have a table that I need to export out to a text fiel, without column headers. I also need to have the file name include currernt date. Can anyone help me? I'm using the following code: ...
1
by: thokala | last post by:
Hi Everyone, I have XML file. It have some date to display the Graph. In that file i need to provide the date value. I would like to give the current date instead of hard coded date. I tried...
1
by: danibecr | last post by:
I'm trying to make a table that will daily count the records imported and save them to a seperate table along with the date imported. But as of now after all the processing is complete I delete...
11
by: dmorand | last post by:
I'm having some trouble with my javascript which is supposed to hide/show a div element. I have to click on the link twice before it'll hide. I can't seem to figure out why the first click does...
7
hodgeman
by: hodgeman | last post by:
Hello thescripts forums users... I've found a lot of answers to problems I've had in the past from this forum, and this is the first mySQL query issue I haven't been able to find an answer from...
3
by: janetopps | last post by:
I have a news website, with asp pages, which was on Access, and i upgraded to MySQL, i used Bullzip to transfer the data. It had about 1000 pages, which im now able to pull up on the public side. Im...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.