I have a form and a subform. I have a button on the form to export to pdf a report. However I currently have to go through every record on the main the form and press the button to export the report specific to that particular report. How can I get my code to run through each record on the main form?
Private Sub Command15_Click ()
On Error GoTo Err_Command15_C lick
Dim stDocName As String
stDocName = "Contract Status Report with Open IR"
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF, "CC" & Me.CC & " " & stDocName & " P9 as of January 6th 2012.PDF"
Exit_Command15_ Click:
Exit Sub
Err_Command15_C lick:
MsgBox Err.Description
Resume Exit_Command15_ Click
End Sub
Private Sub Command15_Click ()
On Error GoTo Err_Command15_C lick
Dim stDocName As String
stDocName = "Contract Status Report with Open IR"
DoCmd.OutputTo acOutputReport, stDocName, acFormatPDF, "CC" & Me.CC & " " & stDocName & " P9 as of January 6th 2012.PDF"
Exit_Command15_ Click:
Exit Sub
Err_Command15_C lick:
MsgBox Err.Description
Resume Exit_Command15_ Click
End Sub
Comment