K
Kirk P.
I wrote some code (OK, I admit I copied the code from "Beginning Access 2000
VBA"). It works great, but I want to take it one step further and so far no
luck. Here's what I've got:
I've got a form called frmReportList with a list box called lstReports and 2
buttons, cmdPrint and cmdPreview. The list box is populated during form load
with this code:
Private Sub Form_Load()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllReports
strValues = strValues & objAO.Name & ";"
Next objAO
lstReports.RowSourceType = "Value List"
lstReports.RowSource = strValues
End Sub
I've got this procedure that checks to see if a report name is selected:
Private Sub ProcessReport(intAction As Integer)
If Not IsNull(lstReports) Then
DoCmd.OpenReport lstReports, intAction
End If
End Sub
And finally, when the command buttons are clicked, it fires one of these
lines of code:
Private Sub cmdPreview_Click()
ProcessReport acViewPreview
End Sub
OR
Private Sub cmdPrint_Click()
ProcessReport acNormal
End Sub
Everything is great up until this point. What I would like to do it change
the Multi Select property of lstReports to Extended, giving me the ability to
select multiple reports from lstReports and Print or Preview them. I having
trouble writing the code to work with my existing code to make this work.
Any ideas?
VBA"). It works great, but I want to take it one step further and so far no
luck. Here's what I've got:
I've got a form called frmReportList with a list box called lstReports and 2
buttons, cmdPrint and cmdPreview. The list box is populated during form load
with this code:
Private Sub Form_Load()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllReports
strValues = strValues & objAO.Name & ";"
Next objAO
lstReports.RowSourceType = "Value List"
lstReports.RowSource = strValues
End Sub
I've got this procedure that checks to see if a report name is selected:
Private Sub ProcessReport(intAction As Integer)
If Not IsNull(lstReports) Then
DoCmd.OpenReport lstReports, intAction
End If
End Sub
And finally, when the command buttons are clicked, it fires one of these
lines of code:
Private Sub cmdPreview_Click()
ProcessReport acViewPreview
End Sub
OR
Private Sub cmdPrint_Click()
ProcessReport acNormal
End Sub
Everything is great up until this point. What I would like to do it change
the Multi Select property of lstReports to Extended, giving me the ability to
select multiple reports from lstReports and Print or Preview them. I having
trouble writing the code to work with my existing code to make this work.
Any ideas?