Creating score by counting weighted checkboxes?

  • Thread starter Thread starter John D. Peterson
  • Start date Start date
J

John D. Peterson

I'm trying to develop a scoring system by examining
checkboxes on a dislayed form but the syntax is eluding
me. I've tried vatiations of the following in Default
Value for [Score] using Expression Builder to no avail:

(IF [PBS] = "Yes" THEN 20 ELSE 0) + (IF [BT] = "Yes" THEN
10 ELSE 0) + (IF [MS] = "Yes" THEN 10 ELSE 0)

Where [PBS], [BT] and [MS] are Yes/No Checkboxes and the
expression is in the numeric field [Score]. If all three
checkboxes on the form are checked by the user, the Score
field should reflect a total of 40 and if only [PBS] is
checked the total should be 20.

Also do I need or should I have an event trigger of some
sort (i.e. [PBS].OnGotFocus) reflected in the expression
to cause the score to update as checkboxes are
manipulated by the user?
 
Try setting the ControlSource for [Score] to something
along the lines of
= CInt(IIf([PBS],20,0)) + CInt(IIf([BT],10,0)) +
CInt(IIf([MS],10,0))

Hope This Helps
Gerald Stanley MCSD
 
Thanks! It works perfectly.
-----Original Message-----
Try setting the ControlSource for [Score] to something
along the lines of
= CInt(IIf([PBS],20,0)) + CInt(IIf([BT],10,0)) +
CInt(IIf([MS],10,0))

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I'm trying to develop a scoring system by examining
checkboxes on a dislayed form but the syntax is eluding
me. I've tried vatiations of the following in Default
Value for [Score] using Expression Builder to no avail:

(IF [PBS] = "Yes" THEN 20 ELSE 0) + (IF [BT] = "Yes" THEN
10 ELSE 0) + (IF [MS] = "Yes" THEN 10 ELSE 0)

Where [PBS], [BT] and [MS] are Yes/No Checkboxes and the
expression is in the numeric field [Score]. If all three
checkboxes on the form are checked by the user, the Score
field should reflect a total of 40 and if only [PBS] is
checked the total should be 20.

Also do I need or should I have an event trigger of some
sort (i.e. [PBS].OnGotFocus) reflected in the expression
to cause the score to update as checkboxes are
manipulated by the user?
.
.
 
Back
Top