Results 1 to 13 of 13
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word and Forms (2003)

    I'm sure it has been asked but how do I create a drop down list in a form to show standard short phrases that the user can select and still the allow user to add a new one that is not listed?

    Also, how do I anchor a field to keep it from shifting and the rest of the line?

    Thanks!

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

    Re: Word and Forms (2003)

    The dropdown form field from the Forms toolbar only allows the user to select a value from the list. The combo box from the Control Toolbox (both in a document and on a VBA userform) allows the user to enter text that is not in the list if the Style property is set to fmStyleDropdownCombo (this is the default setting).

    Not quite sure what you mean by your second question; perhaps placing a field or control in a table cell will do what you want.

  3. #3
    2 Star Lounger
    Join Date
    Dec 2003
    Location
    Ossining, New York, USA
    Posts
    114
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Re: Word and Forms (2003)

    Is your second question how to prevent the user from entering so much info that he changes the page breaks? If so there are 2 ways: limit the number of spaces that he is allowed to use or use tables and limit the size of the row. I have seen forms in PDF where after "x" number of spaces the font size changes to a smaller font. I have no I idea if Word has this capability and assume that if it does it uses VBA.

    Fred

  4. #4
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word and Forms (2003)

    Yes, that's what I meant. Thanks!

  5. #5
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word and Forms (2003)

    Thanks HanV! I added a combo list box to my form but how do I add my items. The VBA screen doesn't look lke any of the Access screens that I'm familar.

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

    Re: Word and Forms (2003)

    You'll need code in the Document_Open event (in ThisDocument) to populate the list, for example:

    Private Sub Document_Open()
    With Me.ComboBox1
    .AddItem "California"
    .AddItem "Oregon"
    .AddItem "Washington"
    End With
    End Sub

  7. #7
    3 Star Lounger
    Join Date
    Aug 2004
    Posts
    361
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word and Forms (2003)

    Hans, I created the Combobox and then entered your code. The box is not populating. Is there some other step?

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

    Re: Word and Forms (2003)

    The combo box will be populated when the document is opened. The code MUST be in the ThisDocument module, not in a standard module, and ComboBox1 must be replaced with the actual name of your combo box.

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word and Forms (2003)

    Hans, you surprise me!
    Instead, what about something lke:

    .AddItem "Drenthe"
    .AddItem "Friesland"
    .AddItem "Utrecht"

    Alan

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

    Re: Word and Forms (2003)

    What suprises you? That I know the names of some states in the USA? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  11. #11
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Jacksonville, North Carolina, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word and Forms (2003)

    Thanks, again it works like a charm. However, when there could be multiple items selected from the list of items. How best should I handle this and still allow the user the capability to add an item that is not in the list of pre-defined choices?

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

    Re: Word and Forms (2003)

    I don't understand - you can only select one item in a dropdown list, not multiple items.

  13. #13
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Word and Forms (2003)

    Common ways to allow multi-selection are listboxes (using Ctrl+click) and "add to set" schemes where the user selects a listed object in one control, and then presses a button to store that item in a separate control (listbox or textbox). Depending on your application's needs and your form's space constraints, you can decide which works best.

Posting Permissions

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