I have a query used as the source for a report. The query criteria is a List Box (List0). Trying to write code to loop through all of the entries of the List Box and save a separate report for each. Not getting errors -- but also getting a blank report!
Code:
Private Sub Command3_Click() Dim i As Integer Dim lbox As ListBox Dim myPath As String Dim strReportName As String Set lbox = Me![List0] myPath = "K:\CLE05\Business Resource Center\Opportunity Tracking\" strReportName = lbox.ItemData(i) For i = 0 To lbox.ListCount - 1 'Access each item with 'Me.ListBoxName.ItemData(i) DoCmd.OutputTo acOutputReport, "Pipeline - All Rms - AUTO-REPORT", acFormatPDF, myPath & strReportName & ".pdf", False, , , acExportQualityPrint 'Debug.Print lbox.ItemData(i) Next i End Sub
Comment