Re: Custom Parameter Dialogs for Reports

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Selecting query criteria via a pull down list
    ... Is the query the end of the process, or is the query to be the record ... Let's assume it is a CustomerID number you need as criteria. ... Add a combo box that will show the CustomerID field. ... Run the Report. ...
    (microsoft.public.access.queries)
  • Re: Use Frm to Open Rpt Based on Qry
    ... I created the rpt using the qry as its record source. ... the report. ... Let's assume it is a CustomerID number you need as criteria. ... Hide the CustomerID field by setting the Combo box's ColumnWidth ...
    (microsoft.public.access.reports)
  • Re: Prompting for a Parameter in an Access 2007 Report
    ... the report. ... shows the data you wish to display for ALL records. ... Let's assume it is a Customer you need as criteria, ... Hide the CustomerID field by setting the Combo box's ColumnWidth ...
    (microsoft.public.access.reports)
  • Re: drop down list within a query?
    ... I have done as suggested and i now get this message "The command or action ... When the code window opens the cursor will be flashing between 2 ... Let's assume it is a CustomerID number you need as criteria. ... Run the Report. ...
    (microsoft.public.access.queries)
  • Re: Prompting for a Parameter in an Access 2007 Report
    ... create a query that will display the fields you wish to show in ... the report. ... Let's assume it is a Customer you need as criteria, ... Hide the CustomerID field by setting the Combo box's ColumnWidth ...
    (microsoft.public.access.reports)