none
MS Word 2018 Populate 1 field based upon the selected item in a combo box RRS feed

  • Question

  • I have a dropdown box in MS Word with the title of "DOK". I want to change the value of another field based upon the value selected in the combo box.

    I've tried referencing it with an IF formula

    IF "<<DOK>>"="1 - Recall"  "True" "False"
    

    where DOK is the name of the combo box, but I keep getting "False". I also replaced the carats with curly brackets and no quotation marks, and still received false.  Will I need to do this with some form of VBA or am I not referencing it correctly? Thank you.

    Monday, May 13, 2019 2:21 PM

All replies

  • Assuming that this is a Form field type drop down, not a content control or Active X dropdown, and the name you have given to the dropdown in the form field properties is DOK, syntax that should work is

    { IF "{ DOK }" = "1 - Recall" "True" "False" }

    where the {} are the special field brace pairs you can insert using ctrl-F9 on Windows Word and command-F9 (cmd-F9) or fn-command-F9/fn-cmd-F9) on Mac Word, depending on your keyboard setup.

    Another thing to check is that the text you are comparing with (1- Recall) is *exactly* what is in the dropdown - make sure you do not have additional spaces and that the case is correct. 

    Using chevron characters or lookalikes (<< >> etc.) does not work.

    Since DOK is labelled as a "bookmark" in the Properties dialog box of the drop down, in theory the following could be expected to work:

    { IF DOK = "1 - Recall" "True" "False" }

    However, this syntax does not work for bookmarks specified in dropdown fields.

    Peter Jamieson

    Monday, May 13, 2019 5:10 PM
  • IF it's a Dropdown Formfield you're referring to, the dependent field would be coded as:

    {IF{REF DOK}= "1 - Recall" "True" "False"}

    Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); you can't simply type them or copy & paste them from this message. The spaces represented in the field constructions are all required. The 'REF' in the field code must also be supplied - it won't work without it.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Monday, May 13, 2019 10:41 PM