Select value of Combo box based on Total Score

cft

Registered User.
Local time
Today, 21:49
Joined
Dec 31, 2001
Messages
52
I have read through many of the questions related to this, but am not clear on how to achieve a "Comment" of "Exceptional (98-100)", "Satisfactory (95-98)", and "Needs Improvement" based on the value of a field "Total Score" which adds the various points in categories on a form. The "Total" box keeps the running tally of scores as they are input. Once the form is filled, and the final score is reached, I want the "Comments" box to autopop with the appropriate comment. This seems simple, but I cannot get to base 1. I have used autofill previously to list "Reason Code Definitions" based on the "Reason Category" selected by use of Requery Macro, but this still requires selection of the result. In this case, I wish to have it just show up. Thanks for any help you may provide.
 
First, you need to think of how your app will know the "final" total has been reached instead of showing the message as each field on the form is updated. I'm thinking you could place code in the AfterUpdate event of the last field on the form that will receive data. Or, you could have a "save" button that could run the code.

The code would be something along the lines of:

dim score as integer

score = me.txtFinalScore

select case score

case 98 to 100
me.comments = "Exceptional"
me.comments.visible = true

case 95 to 97
me.comments = "Okay"
me.comments.visible = true

Case 90 to 94
me.comments = "Yikes - this is bad!"
me.comments.visible true

case else

end select

You'll need to play around with the visible properties of the comments textbox to be sure it toggles on and off when you want it to.

Hope this gives you some ideas



[This message has been edited by Elana (edited 05-02-2002).]
 

Users who are viewing this thread

Back
Top Bottom