file name for output to macro

B

Blakey300

Hi

I am using Access 2007 and have a macro to output reports to a .pdf file (I
have downloaded the pdf add in from ms)

I would like the system when creating the file name to automatically add the
date (in reverse order at the start of the file name so that they appear in a
logical order in the host folder)

so am thinking i want something like this:

="C:\Users\Dave Blake\Documents\Keibudo Karate\" & Year() & Month() & Day()&
"inactive.pdf"


Does anyone know if this is possible or have an alternative method.

many thanks

dave
 
F

Fifth2009

Hi Dave -

I am running into this exact problem, right now, have you been able to find
a solution? I have tried what I thought 'should' be right, but it is not
working. I am fairly new to access, so by no means a pro.

Any help would be great!
 
B

Blakey300

Hi Firth

Yup I cracked it using the following within my DB

=DLookUp("StudentFileLocation","File Locations") & [FolderName] & "\" &
Format(Date(),"yyyy mm dd") & " Child Protection Form.pdf"

As you can see I actually set up a file locations table in my DB however
this isn't required, and I have only done it this way due to how my DB is
going to be used.

You can simplifiy by using this:

="C:\Users\Dave Blake\Documents\Keibudo Karate\" & Format(Date(),"yyyy mm
dd") & "inactive.pdf"

If you dont want spaces between the year, month and day you can just delete
the spaces seperating yyyy mm dd, however I personally find it easier to read
with the spaces.

Also as you are new to Access i recomened checking out www.allenbrowne.com
for some awsome hints and tips, as i have learnt so much from Allen's site (
the guy is an access MVP and a genius when it comes to MS Access)

I hope this helps, let me know how you get on, if you need further help with
this please post back.

Regards

Dave

(e-mail address removed)
 

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