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

Multiple Report parameters via 1 master form

Status
Not open for further replies.

Carol57

IS-IT--Management
Nov 5, 2000
19
CA
I have a number of different reports each asking for certain information via parameters set up within different forms. What I would like to know, is, can one form
handle all the queries for a number of reports, utilizing the visible of certain fields l and if so, how can this be called on via the reports.

Thank you.
 
Yes, I have done this before. This requires a table of reports. Description, Report Name, Active, etc. This table is kept up to date with your reports that are to be used by the user.

Next step create a new form called frmReportsSelection. This form starts out with an Unbound Combobox at the top that has as its RowSource a query of the Active reports from your table. Column 1: Description, Column 2: ReportName, Column 3: Active = True Bound column would be Column 2. Column Widths are 2";0;0

Name the combo ReportsCombo

Now after the User picks a report to be printed, VBA code in the AfterUpdate event procedure would execute:

Select Case Me.ReportsCombo
Case "rptReportName1"
me.txtbox1.visible = true
me.txtbox2.visible = true
me.txtbox3.visible = true
me.txtbox1.setfocus
Case "rptReportName2"
'. . . same for as many reports as necessary
End Select

After each report is picked from the combobox the txtboxes that are necessary for user prompted selection input are made visible. After updating the txtboxes with data a Print report button at the button of the form would be selected by the user to run the following code:

DoCmd.OpenReport Me.ReportsCombo, acViewPreview

The queries for the reports would refer back to this open form with the following syntax:
FORMS![frmReportsSelection]![txtbox1]

Your Reports will then run using queries that are relating back to this form and the data that the user has entered into the visible txtboxes appropriate for the form. The boxes for all the reports will overlay and get a little confusing on the form in design view but many of the controls can be used by more than one report.

Let me know if this sounds like what you would like to do.

Bob Scriver
 
Dear Bob:

Sounds exactly like what I want to do - I will try it out tomorrow and get back to you. If it works, it will certainly allow me to do away with a number of forms.

Again, many thanks.

Carol
 
What if the text boxes on the form are not chosen?
The query expects a value for each text box doesn't it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top