469,127 Members | 1,279 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,127 developers. It's quick & easy.

Populate a text box with text based on a score

I have an access form which is used for auditing purposes.

As part of the process, a score is calculated on the form which displays on the last tab of my form to prompt the user as to who they need to notify based on the score.

For example, a score of more than 80 is a "Low Risk", a score of less than 80 is a "medium risk" and a score of less than 50 is a "high risk".

What I need to do is have a text box that can display the "Low Risk" etc. text based on the outcome of a score which is populated in the txtscore box.

Any ideas on how I can do this?
Oct 29 '14 #1

✓ answered by zmbd

Another method to this is to use a table.
have your cutoffs in one field with the related text in the second field.
This way instead of having to re-code the form should you need to change the text or the cutoff range(s) you simply alter the table.

4 962
twinnyfo
3,653 Expert Mod 2GB
benny1983,

Try something like this:

Expand|Select|Wrap|Line Numbers
  1. Me.txtOverallRisk = IIf(Me.txtScore >= 80, "Low Risk", _
  2.     IIf(Me.txtScore < 50, "High Risk", "Medium Risk"))
Hope this hepps!
Oct 29 '14 #2
Perfect - Thanks very much!
Oct 29 '14 #3
twinnyfo
3,653 Expert Mod 2GB
Glad I could be of some service! Have a great day!
Oct 30 '14 #4
zmbd
5,400 Expert Mod 4TB
Another method to this is to use a table.
have your cutoffs in one field with the related text in the second field.
This way instead of having to re-code the form should you need to change the text or the cutoff range(s) you simply alter the table.
Oct 30 '14 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by CARIGAR | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.