Please, I need to suppress printing a graph of only 1 record

C

charter

I do alot of Reports with graphs inserted. I need to suppress
printing/viewing a graph or state header section
if the count(*)<2, that is if there is 1 record or less in that state.
The records are sorted by state, usually a state has many records (one for
each city), but
often there is only one record in a state. If only one record, then I want to
block or skip over
the drawing of that bar chart for that state. As is, the report draws fifty
pages of graphs, but
the graphs with only one record is silly.
I am a newbie going into experienced, so please give me a sample code line:
US table, city field, state field--this is the break or header criteria.
I have tried dcount(state, table, >1), etc. with no luck in the query, just
gives the total # of records in query
I may need a dcount in a query if I can get dcount to vary with each state
break as the critieria.
Or can I make the graph or header conditional on count(*)<2?
Many thanks,
Greg
 
D

Duane Hookom

If you want to prevent the printing of a group header section when the count
of records for that group is less than 2, you can try:
1) add a text box in the group header
Name: txtGroupCount
Control Source: = Count(*)
2) add code in the On Format event of the Group Header
Cancel = Me.txtGroupCount<2
 

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