parameter query list

G

Guest

I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?
 
G

Guest

Ok, thanks , I'll plow, through that.

But is there a way to have the creteria in the query lookup a city list?

fredg said:
I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?



Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CityID field and the CityName.
Name the Combo Box 'FindCity'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CityID] field criteria line write:
forms!ParamForm!FindCity

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

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

When ready to run the report, open the report.
The form will open and wait for the selection of the City.
Click the command button and then report will run.
When the report closes, it will close the form.
 
F

fredg

I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?



Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CityID field and the CityName.
Name the Combo Box 'FindCity'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CityID] field criteria line write:
forms!ParamForm!FindCity

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

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

When ready to run the report, open the report.
The form will open and wait for the selection of the City.
Click the command button and then report will run.
When the report closes, it will close the form.
 
F

fredg

Ok, thanks , I'll plow, through that.

But is there a way to have the creteria in the query lookup a city list?

fredg said:
I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CityID field and the CityName.
Name the Combo Box 'FindCity'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CityID] field criteria line write:
forms!ParamForm!FindCity

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

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

When ready to run the report, open the report.
The form will open and wait for the selection of the City.
Click the command button and then report will run.
When the report closes, it will close the form.

No, you have to use a form as I posted.
 
G

Guest

Thanks but I need to refine my question with additional info:

I have a report one field of which is [city]. [city] is the field for the
creteria :[CITYCODES]. I have a list of [CITYCODES] in a linked table, [City
Codes]. How do I used the field list of CITYCODES as the criteria for a
reports for each individual CITYCODES?


fredg said:
Ok, thanks , I'll plow, through that.

But is there a way to have the creteria in the query lookup a city list?

fredg said:
On Mon, 12 Mar 2007 21:13:13 -0700, sierralightfoot wrote:

I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CityID field and the CityName.
Name the Combo Box 'FindCity'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CityID] field criteria line write:
forms!ParamForm!FindCity

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

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

When ready to run the report, open the report.
The form will open and wait for the selection of the City.
Click the command button and then report will run.
When the report closes, it will close the form.

No, you have to use a form as I posted.
 
F

fredg

Thanks but I need to refine my question with additional info:

I have a report one field of which is [city]. [city] is the field for the
creteria :[CITYCODES]. I have a list of [CITYCODES] in a linked table, [City
Codes]. How do I used the field list of CITYCODES as the criteria for a
reports for each individual CITYCODES?

fredg said:
Ok, thanks , I'll plow, through that.

But is there a way to have the creteria in the query lookup a city list?

:

On Mon, 12 Mar 2007 21:13:13 -0700, sierralightfoot wrote:

I have a report one field of which is [city]. I have a list of cities. How do
I used this list of cities as the criteria for a reports for each individual
city?

Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
CityID field and the CityName.
Name the Combo Box 'FindCity'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Report's Record Source [CityID] field criteria line write:
forms!ParamForm!FindCity

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

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

When ready to run the report, open the report.
The form will open and wait for the selection of the City.
Click the command button and then report will run.
When the report closes, it will close the form.

No, you have to use a form as I posted.

You have a table named "City codes" and a field named "Citycodes"?
I would strongly suggest you change the table name to something else
(not the same as the field name). Perhaps "tblCities" or if you must,
"tblCityCode".

Anyway, if CityCodes is the only field in the table, and it is Text
datatype, then, as RowSource for the Combo Box, write:

Select YourTableName.[CityCodes] from YourTableName Order By
[CityCodes];

This will load the combo box with the name of all the cities in your
table.

Then, as the criteria for the City column in the query, write:
forms!ParamForm!NameOfComboBox
 

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