Print Reports from List Box

  • Thread starter Thread starter Mike C.
  • Start date Start date
M

Mike C.

Hello.

I inherited a database that contains about about 75+
separate reports. In the past, users were required to
actually print the report they wanted by going to the
REPORTS section of the database and selecting the report
from there.

Is there a way to have the reports listed in a list box
and have the user open the report from there by double-
clicking on the name?

Any assistance would be appreciated.

mike
 
Hello.

I inherited a database that contains about about 75+
separate reports. In the past, users were required to
actually print the report they wanted by going to the
REPORTS section of the database and selecting the report
from there.

Is there a way to have the reports listed in a list box
and have the user open the report from there by double-
clicking on the name?

Any assistance would be appreciated.

mike
Mike,
With 75 reports I would suggest a Combo Box not a List Box.
If the report 'names' are user friendly, in other words the name of
the report is explicit as to what the report is about, set the
RowSource type of the Combo Box to:
Table/Query

Set the Rowsource to:

SELECT MSysObjects.Name FROM MSysObjects WHERE
(((Left([Name],1))<>"~") AND ((MSysObjects.Type)=-32764)) ORDER BY
MSysObjects.Name;

If the names are not 'user friendly', I would suggest a new table with
2 fields:
[ActualReportName] (No Duplicates) and [UserFriendlyName].

Set the RowSouce Type to Table/Query
Set the RowSouce to:

Select YourTableName.[ActualReportName],
YourTableName.[UserFriendlyName] From YourTableName Order By
UserFriendlyName;

Set the Bound Column To 1
Set Column Count to 2
Set Column Widths to 0";1"

In either case
Set the Combo AutoExpand to Yes
Set the Combo Limit To List to Yes
and code the AfterUpdate event:
DoCmd.OpenReport Me!ComboName, acViewPreview

The user will begin to enter the UserFriendlyName.
When it appears in the combo box, press Enter.

The first method requires no maintenance. If a report is added or
deleted it is automatically added or deleted from the list.

The second method requires that the report, and it's user friendly
name, be added to, or deleted from, the table as needed.
 
I would create a table of reports with fields like:
tblReports
==============
rptObjectName (name of report object)
rptTitle
rptActive
rptCategory
rptDescription
rptAuthor
Then categorize all reports into manageable groups of 12 or fewer. Create
one list box to select the category and the other listbox based on the
selected category.
 
I use a naming convention for all my objects that I never expose to users. I
wouldn't want them to see a name like "rptEmpWorkOrds". That is why I use a
table. I also create quite a number of subreports which are not included in
tblReports since they are never opened by themselves.
 
Back
Top