automate file name with report date

O

outrigger

I have a form that automatically updates report data, with the date put in
the form. These reports are then run by use of a macro that outputs them all
as SNP files. all at once. Each time the report is run it states file
already exist do I want to overwrite file, since the file is the same name
that is understandable. I would like to get the new month to automatically
appear on the file title for each report.snp. ie Nov report.snp where the
original file was report.snp. I cannot use the Date or Now functions because
the true date of the report is 3 monts in the past. I do have a table with
the last date that was updated as it's first record. This is updated every
time the report is updated.
Any suggestion?
 
J

Jeff Boyce

Are you sure "the new month" will work for your situation?

After all, each year has a "January", a "February", ...

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
O

outrigger

Wel the criteria table's field Dateofinterest is formated as
1/1/2009,2/1/2009,etc only the month, first day ie1, and then the year are
used. This grabs all the records dates for that particular month. So I
guess the actual 1/1/2009 would work.
Have some suggestions?
 
J

Jeff Boyce

It's important to remember the distinction between how dates are formatted
(e.g., "displayed"), and how they are stored.

Display format only affects how they appear...

Are those fields in the table actually Date/Time values?

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

Jeff Boyce

If you are trying this in a query (you mentioned "selection criterion"), you
could use criterion for that date/time field that calculated the date three
months ago.

Take a look at Access HELP for the DateAdd() function, and use the Date()
function to get today's date. If you ONLY need to know a month (and year!),
you could use the Month() and Year() functions.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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

Top