Changing pdf report name with macro

  • Thread starter Thread starter Don Moore
  • Start date Start date
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.
 
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
 
Back
Top