Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox --> Report Batch Process

Status
Not open for further replies.

mtompkins

IS-IT--Management
Jan 14, 2003
166
0
0
US
I would like to produce a series of reports - pulled from a multiselect ListBox.

The issue is - the process completes but only the last report of the selections is shown (as expected).

Any thoughts as to how I might be able to produce this batch process into a "bundled multi paged" final report?

Here's the current code pulling the report:

Code:
Private Sub Command0_Click()

If IsNull(Forms!frmMenu!Combo14) Then GoTo ErrHandler

Dim lst As ListBox
Dim varItem As Variant
Dim strSql As String
Dim i As Single
Dim Count As Single
    
Set lst = Me!List6
Count = lst.ItemsSelected.Count
If Count = 0 Then
    MsgBox "-- Please select the market(s) to process --", vbExclamation, "No Data Selected"
    Else
    For i = 0 To Count - 1
        For Each varItem In lst.ItemsSelected
            Call GoldenWave(lst.Column(0, varItem), lst.Column(1, varItem), lst.Column(2, varItem), lst.Column(3, varItem), lst.Column(4, varItem), lst.Column(6, varItem), lst.Column(7, varItem))
        Next varItem
        Call PrintFutReport
    Next i
    End If

ErrHandler:
If IsNull(Forms!frmMenu!Combo14) Then
    strMsg = "Please pick a report first."
    strTitle = "Report Selection Required"
    intStyle = vbOKOnly
    MsgBox strMsg, intStyle, strTitle
    Cancel = True
End If
ExitHandler:

End Sub

 
Not sure what GoldenWave does, but it sounds cool! Maybe the Call PrintFutReport should be before the Next varItem?

 
Yes that was a typo and I sorted that -

The batch print (acViewNormal) prints fine.

Its the printing (acViewPreview) that only shows the first report (as it seizes the preview "snapshot" window).

I was wondering if anyone had any ideas on combining reports into a single, multipage report like the collection of printed materials will be.
 
I've done it for a known number of reports by putting each report in a subreport with a pagebreak afterwards. But one that's as dynamic as yours would be a bit hairy to code. I'm not sure what the limit is for subreports on a report, but if you setup a report with x amount of subreports with blank SourceObjects, then loop through your listbox and populate names on the SourceObjects for each subreport during the On Open event of the report, and hide the unused subreports. Just an idea.
 
Part of the many problems - I don't know how many reports the user will pick - its based on markets that they want to run reports for.

They may select one or 200 - which makes embedding subreports unrealistic.

I do appreciate the thought however.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top