Need some urgent(-ish) advice from an MVP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a lot of information that I send to a spreadsheet with the click of a
button. The manager has requested the date and time be included in the
filename of the spreadsheet.

What is the easiest method (if there is one) to do this.
 
I didn't think to search for it as I didn't realise it would have been asked
before.
 
I found the following code:


Dim sToday As String

sToday = Format(Date, "mmddyyyy") & "_" & Format(Time, "hhmm")
DoCmd.TransferSpreadsheet acExport, 8, "VRM for Export", "C:\My
Documents\FILE" & sToday & ".xls", True


I want to check if the following would work before I continue:


Dim sToday As String

sToday = Format(Date, "mmddyyyy") & "_" & Format(Time, "hhmm")

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_Anna", _
"C:\Outstanding Queries" & sToday & ".xls", True , "Anna"
 
Its okay now.

--
www.ae911truth.org



scubadiver said:
I found the following code:


Dim sToday As String

sToday = Format(Date, "mmddyyyy") & "_" & Format(Time, "hhmm")
DoCmd.TransferSpreadsheet acExport, 8, "VRM for Export", "C:\My
Documents\FILE" & sToday & ".xls", True


I want to check if the following would work before I continue:


Dim sToday As String

sToday = Format(Date, "mmddyyyy") & "_" & Format(Time, "hhmm")

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_Anna", _
"C:\Outstanding Queries" & sToday & ".xls", True , "Anna"
 
scuba,
may I make a suggestion. If you format it as year, month, day, hour,
minute, it will sort better and make the files easier to find in the folder.
sToday = format(now,"yyyymmddhhmm") & ".xls"
 
Cheers



Klatuu said:
scuba,
may I make a suggestion. If you format it as year, month, day, hour,
minute, it will sort better and make the files easier to find in the folder.
sToday = format(now,"yyyymmddhhmm") & ".xls"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top