Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Macro to Remove Drop Down Field (2000/SP-3)

    I've got 3 drop down lists in one table cell listing different offices in different regions due to the number (25) limitation.

    Is it possible, via an on exit macro, that if one of the regions is selected, that the other 2 can be deleted?

    Thanks in advance,
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to Remove Drop Down Field (2000/SP-3)

    You can, but that means the user can never select an office in a different region afterwards. The following are the On Exit macros for the three dropdowns:

    Sub SelectCentral()
    ActiveDocument.Unprotect
    ActiveDocument.FormFields("Eastern").Delete
    ActiveDocument.FormFields("Western").Delete
    ActiveDocument.Protect wdAllowOnlyFormFields, True
    End Sub

    Sub SelectEastern()
    ActiveDocument.Unprotect
    ActiveDocument.FormFields("Central").Delete
    ActiveDocument.FormFields("Western").Delete
    ActiveDocument.Protect wdAllowOnlyFormFields, True
    End Sub

    Sub SelectWestern()
    ActiveDocument.Unprotect
    ActiveDocument.FormFields("Central").Delete
    ActiveDocument.FormFields("Eastern").Delete
    ActiveDocument.Protect wdAllowOnlyFormFields, True
    End Sub

  3. #3
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro to Remove Drop Down Field (2000/SP-3)

    As always, thanks much.

  4. #4
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro to Remove Drop Down Field (2000/SP-3)

    If I tab past the "Pick Central..." to choose "Pick Eastern..." my computer crashes. If I pick the "Pick Central..." it removes both the others. Is there a way that if I want "Pick Region..." that I can tab past the "Pick Central" to choose?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to Remove Drop Down Field (2000/SP-3)

    Hmm, removing the dropdowns in code doesn't seem to be a good idea, after all.

    I would use two dropdowns, one for the region, and one for the office. The list items for the second one change when the user selects a different region. See attached version.
    Attached Files Attached Files

  6. #6
    2 Star Lounger
    Join Date
    Jul 2001
    Location
    Wisconsin, USA
    Posts
    193
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Macro to Remove Drop Down Field (2000/SP-3)

    Hans, I've got it working correctly now. Thanks again for all your help.

Posting Permissions

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