Trouble with DCount

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

I have 5 check boxes on a form. I would like to calculate
how complete the form is based on the number of check
boxes checked (i.e. all 5 boxes checked =100%). How can I
do this? I keep getting an #Error message.
 
I have 5 check boxes on a form. I would like to calculate
how complete the form is based on the number of check
boxes checked (i.e. all 5 boxes checked =100%). How can I
do this? I keep getting an #Error message.

A checkbox is actually a way of displaying the values TRUE = -1 or
FALSE = 0; so you should be able to set the Control Source of a
textbox to

=(- NZ([chkA]) - nz([chkB]) - nz([chkC]) - nz([chkD]) - nz([chkE]))/5

Set the format of the textbox to Percent and it should display the
desired result. You may need to Recalc the form in the afterupdate
event of each checkbox.
 
Thank you very much John, you were right on!

Todd
-----Original Message-----
I have 5 check boxes on a form. I would like to calculate
how complete the form is based on the number of check
boxes checked (i.e. all 5 boxes checked =100%). How can I
do this? I keep getting an #Error message.

A checkbox is actually a way of displaying the values TRUE = -1 or
FALSE = 0; so you should be able to set the Control Source of a
textbox to

=(- NZ([chkA]) - nz([chkB]) - nz([chkC]) - nz([chkD]) - nz ([chkE]))/5

Set the format of the textbox to Percent and it should display the
desired result. You may need to Recalc the form in the afterupdate
event of each checkbox.




.
 
Back
Top