Re: Custom Parameter Dialogs for Reports
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Fri, 23 Jan 2009 11:27:15 -0800
On Fri, 23 Jan 2009 11:16:02 -0800, Kaylen wrote:
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.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- Follow-Ups:
- Re: Custom Parameter Dialogs for Reports
- From: Kaylen
- Re: Custom Parameter Dialogs for Reports
- References:
- Custom Parameter Dialogs for Reports
- From: Kaylen
- Custom Parameter Dialogs for Reports
- Prev by Date: Custom Parameter Dialogs for Reports
- Next by Date: Re: Show current report date and prior report date in same report
- Previous by thread: Custom Parameter Dialogs for Reports
- Next by thread: Re: Custom Parameter Dialogs for Reports
- Index(es):
Relevant Pages
|