Multiple buttons to control data source on a report.

G

ghmag

Hi,

I have a single report I would like to use. The table is structured
with several columns. Is there a way to have multiple buttons on a
form, and configure each button to open the report using a different
data source (different column).

So button 1 would be a report using column 1, and button 2 is for a
report for column 2, and so on.

Thanks.
 
J

John W. Vinson

Hi,

I have a single report I would like to use. The table is structured
with several columns. Is there a way to have multiple buttons on a
form, and configure each button to open the report using a different
data source (different column).

So button 1 would be a report using column 1, and button 2 is for a
report for column 2, and so on.

Thanks.

What do you mean by "using"? what's in these columns, and how does the report
change if you use a different field ("column")?

John W. Vinson [MVP]
 
G

ghmag

"Using" would be the datasource. The report values are the only thing
that would change. To clarify, here's an example:

Table Name = Population

City | North Side | South Side
| East Side | West Side |
------------------------------------------------------------------------------------------------------------------------------------------
Chicago 50
20 20 10
New York 20
30 20 30
Los Angeles 20
30 30 20

My form would have four buttons, one for each "Side". And each button
would open the report, and display the data for the side selected.
 
J

John W. Vinson

"Using" would be the datasource. The report values are the only thing
that would change. To clarify, here's an example:

Table Name = Population

City | North Side | South Side
| East Side | West Side |
------------------------------------------------------------------------------------------------------------------------------------------
Chicago 50
20 20 10
New York 20
30 20 30
Los Angeles 20
30 30 20

My form would have four buttons, one for each "Side". And each button
would open the report, and display the data for the side selected.

I'd suggest that you normalize your table design. You're storing data -
regions - in fieldnames. That's incorrect! What if you decide at some point
that you need *Central*, or NorthEast, SouthEast, etc.?

A proper table design would have fields City, Region, and Population:

Chicago; North Side; 50
Chicago; South Side; 20
Chicago; East Side; 20
Chicago; West Side; 10
New York; North Side; 20

and so on.

Then you could base your report on a parameter query selecting the city *and*
the region to display the values just for that region.

John W. Vinson [MVP]
 
Top