Consulting

Results 1 to 3 of 3

Thread: Checking if a content control combo box value is a number between x and y

  1. #1
    VBAX Newbie
    Joined
    Jan 2014
    Posts
    2
    Location

    Checking if a content control combo box value is a number between x and y

    Hello,

    I am creating a test results template to report scores from a particular test. I have a table in word with content control combo boxes to type in the numerical score. It has to be a combo box because it is possible to obtain a score of "<100" so I have that value as an option in the drop down, but if it isn't that value, the user types in the numerical value.

    Below the table, I have a paragraph describing the test results. There is a sentence where it repeats the numerical value listed in the chart, but it also has a combo box that contains a list of the classification descriptions. For example, scores below 55 are considered "average", scores between 55 and 59 are considered "mildly elevated", scores between 60 and 69 are considered "moderately elevated", and scores 70 and above are considered "extremely elevated".

    So the sentence looks like this: "This individual obtained a score of [score combo box], which fell in the [classification combo box] range."

    I am trying to figure out how to code it so that I can have the classification populate based on the value in the combo box. So if I enter "72" in the score combo box, the classification combo box will show "extremely elevated" because the score combo box value was 70 or above.

    I hope that makes sense. I would greatly appreciate any help you could give me.

    Thanks.

  2. #2
    Odd that your scores don't have a 'below average' class? Apart from that the principles are straightforward enough and the text reproduced using bookmarks populated from the combobox. See attached. The principles can be extended to other dropdowns in the same document by adding more case statements to the macro as appropriate.

    When working with content controls, you should find https://www.gmayor.com/insert_content_control_addin.htm useful.
    Attached Files Attached Files
    Graham Mayor - MS MVP (Word)
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Newbie
    Joined
    Jan 2014
    Posts
    2
    Location
    Quote Originally Posted by gmayor View Post
    Odd that your scores don't have a 'below average' class? Apart from that the principles are straightforward enough and the text reproduced using bookmarks populated from the combobox. See attached. The principles can be extended to other dropdowns in the same document by adding more case statements to the macro as appropriate.

    When working with content controls, you should find https://www.gmayor.com/insert_content_control_addin.htm useful.
    Graham,

    I really appreciate your time and response. Your suggestion worked perfectly. Thank you so much, you are the best!

    Just FYI, the scores don't have a "below average" classification because the test is a measure of a particular set of symptoms, so the only thing we are interested in is an abnormal (i.e. above average) score.

    Take care and have a great day! I'm sure I'll be around in the not so distant future to ask more questions.

    Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •