Custom Parameter Dialogs for Reports

  • Thread starter Thread starter Kaylen
  • Start date Start date
K

Kaylen

All my reports are run based on queries and the queries have parameters. Is
it possible to create a custom parameter dialog form that would run the
reports? Right now in order to run a specific report, I have to enter in the
"Review Date" as a parameter for a query that the report is based on. How can
I make a dialog to help make running the reports easier? I am able to create
custom parameter dialog form to run queries, but do not know how to create
parameter dialog to run reports that based on queries with parameters. Any
direction with this is greatly appreciated!
 
All my reports are run based on queries and the queries have parameters. Is
it possible to create a custom parameter dialog form that would run the
reports? Right now in order to run a specific report, I have to enter in the
"Review Date" as a parameter for a query that the report is based on. How can
I make a dialog to help make running the reports easier? I am able to create
custom parameter dialog form to run queries, but do not know how to create
parameter dialog to run reports that based on queries with parameters. Any
direction with this is greatly appreciated!

The method is similar.

First, create a query that will display the fields you wish to show in
the report.

Second, create a report, using the query as it's record source, that
shows the data you wish to display for ALL records.

Let's assume it is a CustomerID number you need as criteria, as well
as a starting and ending date range.

Next, make a new unbound form.
Add a combo box that will show the CustomerID field as well as the
Customer Name field (you can use the Combo Box wizard to do so).
Set the Combo box's Column Count property to 2.
Hide the CustomerID field by setting the Combo box's ColumnWidth
property to 0";1"
Make sure the Combo Box Bound Column is the
CustomerID field.
Name this Combo Box "cboFindName".

Add 2 unbound text controls to the form.
Set their Format property to any valid date format.
Name one "StartDate".
Name the other "EndDate".

Add a command button to the form.
Code the button's Click event:
Me.Visible = False
Name this form "ParamForm"

Go back to the query. As criteria, on the Query's CustomerID field
criteria line write:
forms!ParamForm!cboFindName

As Criteria on the DateField, write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Code the Report's Open Event:
DoCmd.OpenForm "ParamForm" , , , , , acDialog

Code the Report's Close event:
DoCmd.Close acForm, "ParamForm"

Run the Report.
The report will open the form.

Find the CustomerName in the combo box.
Enter the starting and ending dates.
Click the command button.

The Report will display just those records selected.
When the Report closes it will close the form.
 
Thank you Fred, I am trying what you suggested, but I think i'm not doing it
right. I forgot to mention that my queries which the reports are based on are
not simple select queries, they are calculation queries where a person have
to type in the parameters so that the calculations can run based on the
parameters entered. For example, when I run the query, I wam asked to enter
the review date and then confirm the review date again and the queries will
run based on the dates entered. I'm thankful for further directions.
 
Back
Top