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

Calculating yes/no fields

Status
Not open for further replies.

jlg5454

Technical User
Jan 6, 2005
98
US
Hi,

I have about 20 yes/no check box fields that I need for calculating an average for a field called score. If each check box is checked it is assigned 10pts els 0 points. Is there any example out there I can follow. I keep coming up with errors in the score field.

Thanks for any help.
 
How are ya jlg5454 . . .

The following will return the number of checked boxes in the current record.

Note: for each checkbox of interest add a question mark [purple]?[/purple] to its [blue]Tag[/blue] property!
Code:
[blue]Public Function ChkCnt() As Integer
   Dim ctl As Control
   
   For Each ctl In Me.Controls
      If ctl.Tag = "[b]?[/b]" Then ChkCnt = ChkCnt - Nz(ctl)
   Next
   
End Function[/blue]
[blue]Your Thoughts! . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Twenty checkboxes implies that there may be some normalization issues. It may be as well to examines these, before other problems arise.
 
Thanks for the replies. I'll give them a try
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top