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

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!
 
D

Douglas J. Steele

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top