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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there anyway I can create a menu to select only specific reports?

Status
Not open for further replies.

Tamrak

MIS
Jan 18, 2001
213
US
Hello,

From the Reports Objects, I can create menu to allow users to see all of the reports.

I have just one question:

1. Let's say, the current menu, the users can see all 70 reports. Is there anyway I can create a menu that the users can see only the first 35 and second 35? I create a list box to a form. I do not wish to create 35 buttons for each report.

My reports have been labeled from 01 to 70.

Thank you.
 
You can create a list box with the row source property as follows:

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

( MsysObjects is a hidden system table in Access. It stores everything about every object you make. Reports are defined as type -32764. )

So...You can have the reports listed in the list box, sorting by Mysysobjects.Name.

To have a button to print the report selected in the box:

Private sub cmdPrintReport_Click()
Dim strReportName as string
Let strReportName = Me.ListName.Value

Docmd.openreport strReportName, acViewNormal
End Sub

That should work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top