Calculated control on a report

  • Thread starter Thread starter Duane
  • Start date Start date
D

Duane

Is it possible to have a control(s) in the footer that will count a field.

Example:

I have a field called REP's. It is either a YES or NO. Can one control
count the number or YES' and a second control count the NO's?

I have tried to find and example of this but haven't had any luck. Any help
would be greatly appreciated.
 
Is it possible to have a control(s) in the footer that will count a field.

Example:

I have a field called REP's. It is either a YES or NO. Can one control
count the number or YES' and a second control count the NO's?

I have tried to find and example of this but haven't had any luck. Any help
would be greatly appreciated.

Yes... but you'll need another field in the Query upon which the
report is based. Assuming that REP is a Text field (I hope the
fieldname doesn't contain an apostrophe!!!), put two calculated fields
in the query:

IsYes: -([REP] = "Yes")
IsNo: -([REP] = "No")

These values will be 1 if the equality is true (True is stored as -1),
0 if false.

You can then put a textbox on your report with a control source

=Sum([IsYes])

etc.

John W. Vinson[MVP]
 
Thanks John. That was exactly what I was looking for.


John Vinson said:
Is it possible to have a control(s) in the footer that will count a field.

Example:

I have a field called REP's. It is either a YES or NO. Can one control
count the number or YES' and a second control count the NO's?

I have tried to find and example of this but haven't had any luck. Any
help
would be greatly appreciated.

Yes... but you'll need another field in the Query upon which the
report is based. Assuming that REP is a Text field (I hope the
fieldname doesn't contain an apostrophe!!!), put two calculated fields
in the query:

IsYes: -([REP] = "Yes")
IsNo: -([REP] = "No")

These values will be 1 if the equality is true (True is stored as -1),
0 if false.

You can then put a textbox on your report with a control source

=Sum([IsYes])

etc.

John W. Vinson[MVP]
 

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

Back
Top