Dynamic Filenames

S

simsjr

Hi There.

In our department, we create a daily Excel report and drop it in a
designated folder. We use the same naming convention each day we generate the
report - for example, today's report was called "Report 092804.xls". The
numeric portion of the filename reflects today's date, ie 09-28-04. With me?

Now, what we'd like to do is add a launch button to our Access 97
application that will launch "today's" spreadsheet, and then do the same
thing again each subsequent day. Since we have a consistent naming convention
- with only the date portion of the filename changing - is there a way for
Access to match today's date with today's filename?
 
M

Marshall Barton

simsjr said:
In our department, we create a daily Excel report and drop it in a
designated folder. We use the same naming convention each day we generate the
report - for example, today's report was called "Report 092804.xls". The
numeric portion of the filename reflects today's date, ie 09-28-04. With me?

Now, what we'd like to do is add a launch button to our Access 97
application that will launch "today's" spreadsheet, and then do the same
thing again each subsequent day. Since we have a consistent naming convention
- with only the date portion of the filename changing - is there a way for
Access to match today's date with today's filename?


You can easily create the file name using:

strFile = "Report " & Format(Date, "mmddyy") & ".XLS"

How you "launch" it is up to you, Shell?
 
M

Marshall Barton

Well, I expect you would add

Dim strFile As String

somewhere in the procedure.
 

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