Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Control Source Expression

Status
Not open for further replies.

lchiav

Technical User
Mar 31, 2000
10
US
I am having trouble building an expression for an unbound text field on my report. My database contains a field named Class. The class field data can be I, II, III, IV or V. I would like the results of a count for this field on I, II and III excluding IV and IV. My expression looks like this:

=Count([Class]="I" Or "II" Or "III")

This expression returns a count for everything. What am I missing?
 
i have not ever seen COUNT used that way so i looked thru all kinds of docs and can't find it either.

here's a suggestion:
in your report's RECORD SOURCE, hit the build button.
Add a field in the query grid like this
ClassCount: IIf([Class]="I" Or [Class]="II" Or [class]="III",1,0)

go back to the report.
bring the new field ClassCount onto the report in the detail section next to the rest of your data. eventually you can make it hidden.
in your report footer make your unbound field be
=Sum([ClassCount])

see the report. it should work now.
then you can make the control ClassCount be visible = NO

hope this helps--g
 
That worked. I can't thank you enough! It will be a tremendous time saver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top