Hi
I have a button in report footer that will save each record as pdf but nothing happens and i get error:
Code:
Private Sub Command1_Click()
Dim rpt As Report
Dim i As Integer
Set rpt = Reports("Certificates") 'Replace "Report1" with the name of your report
For i = 0 To rpt.Pages - 1
rpt.PrintOut acSelection, , , , i 'print the current page
Dim fileName As String
fileName = rpt.Controls("canName").Value 'Replace "NameField" with the name of the field in the page header that you want to use as the file name
DoCmd.OutputTo acOutputReport, "", acFormatPDF, fileName & ".pdf"
Next i
End Sub
the error:
Code:
application defined or object defined error