list of search criteria

S

sierralightfoot

I have a report that I print to pdf. I have 10 cities that I want to use
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?
 
B

Boyd Trimmell aka Hi Tech Coach via AccessMonster.

Does each city need to be in a separate PDF file?

If Yes, then you will need to use some type of loop to print he report for
each city.


I have a report that I print to pdf. I have 10 cities that I want to use
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?
 
S

sierralightfoot

Let's forget the print issue and just open the ten reports.

Boyd Trimmell aka Hi Tech Coach via Acce said:
Does each city need to be in a separate PDF file?

If Yes, then you will need to use some type of loop to print he report for
each city.


I have a report that I print to pdf. I have 10 cities that I want to use
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?

--
Boyd Trimmell
aka Hi Tech Coach
http://www.hitechcoach.com
http://www.officeprogramming.com
 
D

Duane Hookom

Can we assume you have a city field in the Record Source of your report? Can
we assume there is a table of cities or a list box with 10 unique cities
selected or a temporary table with 10 cities?

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


sierralightfoot said:
Let's forget the print issue and just open the ten reports.

Boyd Trimmell aka Hi Tech Coach via Acce said:
Does each city need to be in a separate PDF file?

If Yes, then you will need to use some type of loop to print he report for
each city.


I have a report that I print to pdf. I have 10 cities that I want to use
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?

--
Boyd Trimmell
aka Hi Tech Coach
http://www.hitechcoach.com
http://www.officeprogramming.com
 
B

Boyd Trimmell aka HiTechCoach via AccessMonster.co

The simplest approach it it is the same ten cites each time would be:

DoCmd.OpenReport "rptNname"Here, , , "[City] = 'CityName1'"
DoCmd.OpenReport "rptNname"Here, , , "[City] = 'CityName2'"
...
DoCmd.OpenReport "rptNname"Here, , , "[City] = 'CityName10'"

Let's forget the print issue and just open the ten reports.
Does each city need to be in a separate PDF file?
[quoted text clipped - 4 lines]
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?
 
S

sierralightfoot

Yes there is a city field in the record source and a table of unique cities.

Duane Hookom said:
Can we assume you have a city field in the Record Source of your report? Can
we assume there is a table of cities or a list box with 10 unique cities
selected or a temporary table with 10 cities?

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


sierralightfoot said:
Let's forget the print issue and just open the ten reports.

Boyd Trimmell aka Hi Tech Coach via Acce said:
Does each city need to be in a separate PDF file?

If Yes, then you will need to use some type of loop to print he report for
each city.



sierralightfoot wrote:
I have a report that I print to pdf. I have 10 cities that I want to use
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?

--
Boyd Trimmell
aka Hi Tech Coach
http://www.hitechcoach.com
http://www.officeprogramming.com
 
D

Duane Hookom

How do you want to select the appropriate cities to print? An easy method
might be to create a table
tblCitiesToPrint
==============
CityName

Then enter/select cities to add records to tblCitiesToPrint. Write code that
opens the table and moves through its records like:

Dim db as DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT CityName FROM tblCitiesToPrint")
Do While Not rs.EOF
DoCmd.OpenReport "rptNameHere", acPrint, , "[City]=""" & rs!CityName &
""""
rs.MoveNext
Loop
rs.Close
set rs = Nothing
set db = Nothing
--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


sierralightfoot said:
Yes there is a city field in the record source and a table of unique cities.

Duane Hookom said:
Can we assume you have a city field in the Record Source of your report? Can
we assume there is a table of cities or a list box with 10 unique cities
selected or a temporary table with 10 cities?

--
Duane Hookom
Microsoft Access MVP
If I have helped you, please help me by donating to UCP
http://www.access.hookom.net/UCP/Default.htm


sierralightfoot said:
Let's forget the print issue and just open the ten reports.

:

Does each city need to be in a separate PDF file?

If Yes, then you will need to use some type of loop to print he report for
each city.



sierralightfoot wrote:
I have a report that I print to pdf. I have 10 cities that I want to use
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?

--
Boyd Trimmell
aka Hi Tech Coach
http://www.hitechcoach.com
http://www.officeprogramming.com
 
S

sierralightfoot

This seems to be the simple method I'm looking for. But bear with me, I have
no idea where this code goes/get inserted.

What's the Here,,,referance to?

Boyd Trimmell aka HiTechCoach via Access said:
The simplest approach it it is the same ten cites each time would be:

DoCmd.OpenReport "rptNname"Here, , , "[City] = 'CityName1'"
DoCmd.OpenReport "rptNname"Here, , , "[City] = 'CityName2'"
...
DoCmd.OpenReport "rptNname"Here, , , "[City] = 'CityName10'"

Let's forget the print issue and just open the ten reports.
Does each city need to be in a separate PDF file?
[quoted text clipped - 4 lines]
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com
 
B

Boyd Trimmell aka HiTechCoach via AccessMonster.co

Sorry for the type:

"rptNname"Here should have been "rptNnameHere"

Where to place the code?
One possible place is the on click event of a command button.


This seems to be the simple method I'm looking for. But bear with me, I have
no idea where this code goes/get inserted.

What's the Here,,,referance to?
The simplest approach it it is the same ten cites each time would be:
[quoted text clipped - 10 lines]
individually as the criteria in the query field[city]. How can I make the
report use city1, then city2, etc as the criteria for the report?
 

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