• Nested IF fields? (WinXP NL / Off2003 NL)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Nested IF fields? (WinXP NL / Off2003 NL)

    Author
    Topic
    #415130

    In a document there are 2 dropdown formfields, DD1 containing 3 items and DD2 containing 4 or 5 items. Depending on the user’s choices, next to each DD the appropriate text must be displayed. Example for DD1 (helptext 1/2 = max 50 chars):
    Item1 => “” (empty string)
    Item2 => “helptext 1”
    Item2 => “helptext 2”

    Is there a way to do this with (nested) IF fields, so there is no need to use VBA code? One of our users wants to use this in a series of documents. He has no knowledge of programming at all and wants to keep it that way…

    Viewing 1 reply thread
    Author
    Replies
    • #925027

      I nearly managed this by defining Document Properties containing each set of help text, and putting the property names in the dropdown list.

      I then used the field
      { DOCPROPERTY { REF HelpDropdown } }
      to display the help text, where HelpDropdown is the bookmark associated with the dropdown form field.

      The trouble with this is that even with Calculate on Exit set for the Dropdown form field, it needs an update fields to update the help text.

      StuartR

    • #925028

      Double click both dropdown lists (while the document is unprotected) and make sure that “Calculate on exit” is ticked.

      You can use nested fields like this:

      { IF { DDD1 } = “Item1” “” { IF { DD1 } = “Item2” “Helptext1” “Helptext2” } }

      { IF { DDD2 } = “Item1” “” { IF { DD2 } = “Item2” “Helptext1” { IF { DD2 } = “Item3” “Helptext2” { IF { DD2 } = “Item4” “Helptext3” “Helptext4” } } } }

      As always, the field brackets should not be typed, but inserted using Ctrl+F9. The nested field will be updated when the user presses Tab in the dropdown list, not when he/she selects an item.

      • #925029

        Thank you Hans, that is the only reason that my method wouldn’t update the field.

        Here is an example, that may be easier to modify in the future than nested If fields.

        StuartR

        • #925030

          Your solution is much more elegant, and a lot easier to create and maintain. Nested fields are no joy to work with if the number of levels increases.

    Viewing 1 reply thread
    Reply To: Nested IF fields? (WinXP NL / Off2003 NL)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: