Microsoft Access Office VB VBA Help and Examples
           
             

Printing Multiple Reports from a Form

If you have many reports in a database and you would like to give users an easy way to run those reports then this will show you how.

Create a form and put a list box on it. Call the list box ReportList. Set it's row source to 

SELECT msysobjects.Name FROM msysobjects WHERE (((msysobjects.Type)=-32764));

Set it's multiselect property to Simple

Create a button on the form and assign the following code to it.

Dim X As Variant
For Each X In ReportList.ItemsSelected
    DoCmd.OpenReport ReportList.ItemData(X), acViewNormal
Next

That's it. Here's a database with just the one form in it, which  you can import into any other database.

ReportPrinter.mdb

 
HOME   SEARCH SITE   PRIVACY POLICY   CONTACT
The code and application content of this site is copyright of Smiley I.T. and as such reproduction in any form which is for commercial use requires the permission of the Webmaster. Any use of this code for non-commercial use only requires a link or comment back to the original page you took the code from.