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 / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

Date/Time in save as file name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick X - 17 Jan 2006 20:55 GMT
Hi all,

I am sending a query out to a spreadsheet format:

DoCmd.TransferSpreadsheet yadda, yadda, yadda, conPath & "yadda yadda" & " -
Saved_" & Format(Date, "mm-dd-yyyy") & ".xls", True

I would like this portion to show the date AND time:
Format(Date, "mm-dd-yyyy")

Unfortunately, Windows will not allow a file to be saved with the ":"
(colon) character.  Can anyone see a way around this?  I tried using "."
(period) but that returned 0.00.00

Thank you in advance,
Nick X
Ofer - 17 Jan 2006 22:20 GMT
You should use Now() instead of Date() that doesn't return the time.
I would save it in this format

Format(Now(), "yyyymmddhhmm")

It make it easier to sort the file by name in this format
Signature

\\// Live Long and Prosper \\//
BS"D

> Hi all,
>
[quoted text clipped - 12 lines]
> Thank you in advance,
> Nick X
Nick X - 18 Jan 2006 13:19 GMT
Thank you, that'll work.

> You should use Now() instead of Date() that doesn't return the time.
> I would save it in this format
[quoted text clipped - 19 lines]
> > Thank you in advance,
> > Nick X
 
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.