multiple report parameters (one being dialog box with drop down)

P

p-rat

I have a report I'm doing that is collecting data from a query. I have
'date in' and 'date out' parameters. I also have a form I created with
a drop down getting data from a table. The query that the report
dependent upon has the BETWEEN [date in] AND [date out]. When run it
pulls back correct data set. I have a field called 'location' which my
form which looks like a dialog box is dependent upon.

When I run these three parameters on the report the 'date in' window
pops up, the 'date out' window pops up, but then there is a parameter
window which has form!locationselect!combo1 on it that pops up instead
of the form I created for this.

I'm new to this and have looked throughout discussions for an answer.
Could anyone point me in the right direction? It would be greatly
appreciated. Thanks.
 
A

Allen Browne

In your query, try:
[Forms]![locationselect]![combo1]

The form must be named locationselect (without a space), and the combo named
combo1. If the form is open, it is part of the Forms collection (which is
why you need the S at the end of formS.)
 
F

fredg

I have a report I'm doing that is collecting data from a query. I have
'date in' and 'date out' parameters. I also have a form I created with
a drop down getting data from a table. The query that the report
dependent upon has the BETWEEN [date in] AND [date out]. When run it
pulls back correct data set. I have a field called 'location' which my
form which looks like a dialog box is dependent upon.

When I run these three parameters on the report the 'date in' window
pops up, the 'date out' window pops up, but then there is a parameter
window which has form!locationselect!combo1 on it that pops up instead
of the form I created for this.

I'm new to this and have looked throughout discussions for an answer.
Could anyone point me in the right direction? It would be greatly
appreciated. Thanks.

Do all of the parameter inputting on a form. You won't receive any
prompt.

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 LocationID 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 LocationID field as well as the
Location Name field (you can use the Combo Box wizard to do so).
Set the Combo box's Column Count property to 2.
Hide the LocationID field by setting the Combo box's ColumnWidth
property to 0";1"
Make sure the Combo Box Bound Column is the
LocationID field.
Name this Combo Box "cboLocation".

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 LocationID field
criteria line write:
forms!ParamForm!cboLocation

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 Location Name 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.
 
P

p-rat

I have a report I'm doing that is collecting data from a query. I have
'date in' and 'date out' parameters. I also have a form I created with
a drop down getting data from a table. The query that the report
dependent upon has the BETWEEN [date in] AND [date out]. When run it
pulls back correct data set. I have a field called 'location' which my
form which looks like a dialog box is dependent upon.
When I run these three parameters on the report the 'date in' window
pops up, the 'date out' window pops up, but then there is a parameter
window which has form!locationselect!combo1 on it that pops up instead
of the form I created for this.
I'm new to this and have looked throughout discussions for an answer.
Could anyone point me in the right direction? It would be greatly
appreciated. Thanks.

Do all of the parameter inputting on a form. You won't receive any
prompt.

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 LocationID 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 LocationID field as well as the
Location Name field (you can use the Combo Box wizard to do so).
Set the Combo box's Column Count property to 2.
Hide the LocationID field by setting the Combo box's ColumnWidth
property to 0";1"
Make sure the Combo Box Bound Column is the
LocationID field.
Name this Combo Box "cboLocation".

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 LocationID field
criteria line write:
forms!ParamForm!cboLocation

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 Location Name 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- Hide quoted text -

- Show quoted text -

Thank you Fred. It worked great. You are THE man!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top