copy pdf file and rename with recordset ID

byTimber

Registered User.
Local time
Today, 09:44
Joined
Apr 14, 2012
Messages
97
Hello All,

I have a pdf template that I wish to copy and identify as being associated with the ID of the record in my Access Table. Attempt below:-

Private Sub Command36_Click()

Dim PDFTemplate As String
Dim recordID As String
Dim newPDF As String
recordID = Me.CurrentRecord
PDFTemplate = "LVFTest"
newPDF = PDFTemplate + Str(recordID)

FileCopy "C:\Other Documents\LVF.pdf", "C:\Other Documents\[newPDF].pdf"

End Sub

Copies OK but whatever I put as a variable produces e.g. above newPDF.pdf

Any help in passing the ID as an appendage to the new file would be appreciated.

Thank you .... Roger ,,
 
Not tested, but try;

FileCopy "C:\Other Documents\LVF.pdf", "C:\Other Documents\" & newPDF & ".pdf"
 
Thanks Sean, Works - Made a good start to my day!! - Roger ....
 

Users who are viewing this thread

Back
Top Bottom