Todays date to Output Module...

HaroldIII

Registered User.
Local time
Today, 05:27
Joined
Feb 2, 2011
Messages
55
DoCmd.OutputTo acOutputQuery, "Exch_Compare", acFormatXLSX, "M:\Exceptions Research\OutPut\(NEED TODAYS DATE HERE)Exchange.xlsx", False

Hi-

I need to add todays date to the output file name. It needs to change every day (Today "3-8-2011Exchange.xlsx) then (tomorrow 3-9-2011Exchange.xlsx)

Its prob a simple code, but the Access Help is not giving me the right answer.:confused:

Thanks
 
Code:
DoCmd.OutputTo acOutputQuery, "Exch_Compare", acFormatXLSX, "M:\Exceptions Research\OutPut\" & Format(Date(),"dd-mm-yyyy") & "Exchange.xlsx", False
 
To concatenate "Hello" to "World" you do "Hello" & "World".

The function for today's date is Date(). To format the date so that it uses hyphen as the delimeter you need the Format() function.

See what you can come up with.
 
To concatenate "Hello" to "World" you do "Hello" & "World".

The function for today's date is Date(). To format the date so that it uses hyphen as the delimeter you need the Format() function.

See what you can come up with.

Accurate and discriptive. Thank you it works and i learned something!! :)
 
Happy to hear you learnt something today HaroldIII :)
 

Users who are viewing this thread

Back
Top Bottom