Exporting Reports with Today's Date

  • Thread starter Thread starter lil lam
  • Start date Start date
L

lil lam

Hi,

I am trying to set a Macros to export Reports to specified locations.
I will be exporting these reports everyday, so I would the dates to
automatically update right after the title.

I tried adding this little expression at the end of the file name, but
with no luck.
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy
[Date].xls

Do I need to add a module or something?
Someone help.

Thank you.
 
Hi,

I am trying to set a Macros to export Reports to specified locations.
I will be exporting these reports everyday, so I would the dates to
automatically update right after the title.

I tried adding this little expression at the end of the file name, but
with no luck.
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy
[Date].xls

Do I need to add a module or something?
Someone help.

Thank you.

Giving us just a snippet of your code doesn't give us much to go on.
By Dates I guess you mean the current date, not a date stored in a
field in your database.

Try...

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy"
& Date & ".xls"

If run today, the above would create a spreadsheet named:

"tbl_A_NSCC_BreakCountsBy5/7/2009.xls"
 
fredg said:
On Thu, 7 May 2009 13:09:01 -0700 (PDT), lil lam wrote:

Try...

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy"
& Date & ".xls"

If run today, the above would create a spreadsheet named:

"tbl_A_NSCC_BreakCountsBy5/7/2009.xls"

Um, I don't think / is a valid character in a file name.

Probably better to use

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy" &
Format(Date, "yyyy\-mm\-dd") & ".xls"

That would produce "tbl_A_NSCC_BreakCountsBy2009-05-07.xls", which has the
advantage that it sorts chronologically.
 
Um, I don't think / is a valid character in a file name.

Probably better to use

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy" &
Format(Date, "yyyy\-mm\-dd") & ".xls"

That would produce "tbl_A_NSCC_BreakCountsBy2009-05-07.xls", which has the
advantage that it sorts chronologically.

Hi Doug,

I used this formula you provided:
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy &
Format(Date, yyyy-mm-dd) & .xls

It gave me this when it finished exporting to my location:
tbl_A_NSCC_BreakCountsBy&Format(Date,yyyymmdd)&.xls

I am really stumped! I have no idea how to make the current date show
up.
Ive been trying all sorts of things this morning...

Am I missing something?

Hanna
 
I am trying to set a Macros to export Reports to specified locations.
I will be exporting these reports everyday, so I would the dates to
automatically update right after the title.
I tried adding this little expression at the end of the file name, but
with no luck.
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy
[Date].xls
Do I need to add a module or something?
Someone help.
Thank you.

Giving us just a snippet of your code doesn't give us much to go on.
By Dates I guess you mean the current date, not a date stored in a
field in your database.

Try...

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy"
& Date & ".xls"

If run today, the above would create a spreadsheet named:

"tbl_A_NSCC_BreakCountsBy5/7/2009.xls"

Hi Fred,

I tried using this formula you gave me:
C:\Documents and Settings\hlim\Desktop\MISC
\tbl_A_NSCC_BreakCountsBy&Date&.xls

This was the result I got:
tbl_A_NSCC_BreakCountsBy&Date&.xls

How is this possible?
Am I missing a module or something?
I think I've tried entering almost entering everything...Help

Hanna
 
Let me see if i can better describe what I am doing.
All I am trying to do is get the current date to appear at the end of
my name of my file after I export it.
These are the steps I took:


In my macros, I choose Transfer Spreadsheet for the Action.
In the Action Arguments:

Transfer Type: Export

Spreadsheet Type: Excel 8 - 10

Table Name: tbl_A_NSCC_BreakCountsByDate

File Name: (This is where I enter the little expression so I can get
the current date)
C:\Documents and Settings\hlim\Desktop\MISC
\tbl_A_NSCC_BreakCountsBy&Date&.xls
I also tried:
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy
&
Format(Date, yyyy-mm-dd) & .xls

Has Filed Names: No
Range: [blank]
 
Did you put your quotes in the same place as in my example?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Um, I don't think / is a valid character in a file name.

Probably better to use

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy" &
Format(Date, "yyyy\-mm\-dd") & ".xls"

That would produce "tbl_A_NSCC_BreakCountsBy2009-05-07.xls", which has the
advantage that it sorts chronologically.

Hi Doug,

I used this formula you provided:
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy &
Format(Date, yyyy-mm-dd) & .xls

It gave me this when it finished exporting to my location:
tbl_A_NSCC_BreakCountsBy&Format(Date,yyyymmdd)&.xls

I am really stumped! I have no idea how to make the current date show
up.
Ive been trying all sorts of things this morning...

Am I missing something?

Hanna
 
Did you put your quotes in the same place as in my example?

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)







Hi Doug,

I used this formula you provided:
C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy &
Format(Date, yyyy-mm-dd) & .xls

It gave me this when it finished exporting to my location:
tbl_A_NSCC_BreakCountsBy&Format(Date,yyyymmdd)&.xls

I am really stumped! I have no idea how to make the current date show
up.
Ive been trying all sorts of things this morning...

Am I missing something?

Hanna

Hi Doug,

This is exactly how I wrote it; actually I just copied and pasted it:

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy"
&
Format(Date, "yyyy\-mm\-dd") & ".xls"

I tried with the quotes, and I get a pop up message:

"Cannot Update. Database or object is read only."
 
In what event are you using the code? What's your exact code?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Did you put your quotes in the same place as in my example?

Hi Doug,

This is exactly how I wrote it; actually I just copied and pasted it:

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy"
&
Format(Date, "yyyy\-mm\-dd") & ".xls"

I tried with the quotes, and I get a pop up message:

"Cannot Update. Database or object is read only."
 
In what event are you using the code? What's your exact code?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Did you put your quotes in the same place as in my example?

Hi Doug,

This is exactly how I wrote it; actually I just copied and pasted it:

"C:\Documents and Settings\hlim\Desktop\MISC\tbl_A_NSCC_BreakCountsBy"
&
Format(Date, "yyyy\-mm\-dd") & ".xls"

I tried with the quotes, and I get a pop up message:

"Cannot Update. Database or object is read only."
 
Back
Top