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

Fill a list box with a list of SELECTED reports

Status
Not open for further replies.

bgibsonIYD

Technical User
Jun 18, 2001
28
US
I have several reports that I feel go into different categories. I want to use a tab format on a form to separate them into their categories. I would like each tab to have a list box and in that list box I would like to have a list of reports in that category that can be opened. I tried entering:

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

into the RowSource property of the list box, but is showed ALL of my reports, and I only want it to show certain ones.

Can anyone help? Beth
**Learning Access**
 
Beth,

Try something I found on your endeavours...


SELECT DISTINCTROW msysobjects.Name, msysobjects.Type, * FROM msysobjects WHERE (((msysobjects.Type)=-32764) AND ((Left([name],3))="rpt"));

Make sure that you prefix your reports with "rpt" and it should find them all.


Angelique

 
Your code goes to the Microsoft tables and pulls the report names. Angelique's code does the same thing, but only pulls reports that begin with "rpt" in their name and not everyone follows that naming convention so her code may not work for you. In order to group things you'll need to build a table yourself that stores the report names and the group that they belong to because the system tables have no facility for storing the group they belong to UNLESS you put the group in the report name and then you can use a variation of Angelique's code to find the string that identifies the group within the report name. Do you follow this or need I explain a little further? Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top