Changing pdf report name with macro

D

Don Moore

I would like to change the name of a report that I will be sending as a pdf.
Is there a way to set up a variable to change the name of the report based on
a field in a table? I've done it with the subject line in a email so I know
that works.
 
T

tina

i don't know how you'd do it in a macro, but you can do it in VBA. open a
standard module, and name it modUtilities. create a public function, as

Public Function isRename()

Name "CurrentFilePath" As "NewFilePath"

Exit Function

replace CurrentFilePath with the complete filepath including the current
filename of the file, and replace NewFilePath with the complete filepath
including the new filename of the file. save the module. you can call the
function directly from an object Event property line in a form, or from an
event procedure in VBA, or from a macro, using the RunCode action.

there are a couple of caveats to consider, so look up the Name Statement
topic in Access VBA Help and read up on it.

hth
 

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