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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Yes, No, exempt in Form

Status
Not open for further replies.

Bandenjamin

Programmer
Oct 18, 2005
649
US
Hey all,

I have a form with 21 combo boxes that you can choose 3 options in (Yes, No, Exempt). I would like to have a box on the form which reports the percentage or "score" of "Yes".

How can I get a count of Yes/Yes+No? I tried using text box with =Sum(IIf([combobox1]="Yes",1,0)) which kept a running total from record to record. I'd like this to remain specific to the current record only. Any suggestions would be great!

Is there a way with maybe an if/else statement to put calculate this over only the current record?

Thanks in advance.

Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body. But, rather to skid in sideways, chocolate in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO what a ride!
 
This may be of interest:
Sum Multiple Fields
thread702-1321967
 
I don't think that one will quite work. I need to keep this specific to the record that is being used. eg. If we are on Record 1 and move to record 2 I want it to reset back to 0


Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body. But, rather to skid in sideways, chocolate in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO what a ride!
 
best bet would be to setup a query or something...

basically, a true evaluates to -1 and false evaluates to 0 so you can just do:

select fields..., abs(fld1 + fld2... + fld21)

if you have to use the form, then you can put the same formula in a text box or something...

--------------------
Procrastinate Now!
 
Did you look at:
[tt]Public Function basSum(ParamArray varMyVals()) As Variant[/tt]

by MichaelRed? It is intended for use with the current record. For example:

[tt]=basSum(txtA,txtB,txtC, ..., txtZ)[/tt]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top