Select report(s) to print via multi-select list box Access 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to add a form with a multi-select list box to allow users to click on
one or more reports then print or print preview via command button. I've
searched for days without finding an answer. I know just enough about Access
to make me dangerous and even less about VB. Ideally, a working sample
database would be great.

Thanks in advance for your help!
 
Private Sub cmdPrintPreview_Click()
Dim varSelected As Variant

For Each varSelected in Me.MyListBox.ItemsSelected
DoCmd.OpenReport Me.MyListBox.ItemData(varSelected), acPrintPreview
Next varSelected

End Sub

This assumes that the bound column of the list box contains the name of the
report.
 
Back
Top