Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Jan 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop-down Box (Forms Toolbar) (Word 2K)

    Hi, All:

    I am working on a form. One of the form fields I want to add is a list of all the counties in the State of Florida (there are 67), line-by-line. Is there some way that the drop down box can be "lengthened" so I can get 68 lines in? (The first line would be "Choose One"). I do not know how to write code (I'm waiting for a good course to come along and teach me--the books I've read so far are still too advanced for me) so if there's a way to do it using the dropdown box in the "forms" toolbar I'd like to go that route.

    TIA,

    Cambot
    camille.stein@dep.state.fl.us <img src=/S/please.gif border=0 alt=please width=31 height=23>

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    Do you mean 68 VISIBLE lines all at once, or 68 entries?

    If you mean Visible lines, then I don't think you can.

    If you mean 68 entries in the dropDown, then yes you can, but you have to fill the dropdown via code.

    <pre>FormFields("Dropdown1").DropDown.ListEntries. Add " -- Please Chooose a County --"
    FormFields("Dropdown1").DropDown.ListEntries.Add "1stCounty"
    ...
    FormFields("Dropdown1").DropDown.ListEntries.Add "67th County"</pre>


    HTH,
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    New Lounger
    Join Date
    Jan 2002
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    Hi, Brian:

    I mean "68 entries". I have your code, now I need to know how to make the "link" (prolly wrong terminology) between the dropdown box and the code you gave me. It looks like you gave me a macro. Is it that I need to record and name this macro and check the "run macro on entry" in the "drop-down field options" dialogue box in the drop-down box in the forms toolbar? Sorry I'm so dense, I'm trying to walk before I can even crawl. <img src=/S/woops.gif border=0 alt=woops width=58 height=36>

    Thanks for your help.

    Camille
    camille.stein@dep.state.fl.us

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    Camille,

    Sorry <img src=/S/sorry.gif border=0 alt=sorry width=15 height=15> I lied to you. That won't work <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

    I was sure I used that before to get around the 25 limit, but I actually tried it and it wouldn't let me add more than 25.

    However, there There is a KB article (Q198561) that describes a workaround invlolving a UserForm to get around the limitation.

    Again, I'm REALLY sorry I lead you down a wrong path <img src=/S/woops.gif border=0 alt=woops width=58 height=36>
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    If 25 entries is the limit then the drop-down form field is going to be a limiting factor.

    A workaround may be: Is it possible to use data from an earlier field to narrow the possible counties in that. For example if the field before is "Which region" with the choices North/South/East/West then you could build the entries in the list from that subset. You need to use code to do it with an On Exit or On Entry macro.

    If this sounds reasonable then let us know and we can give you hints on the macro you will need.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    New Lounger
    Join Date
    Aug 2002
    Location
    Chicago, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    Hi, Andrew
    Allow me to jump on this wagon and ask for macro how to do it.
    I have a similar application in which I need to select in one field "A" 1 of 3 entry and in the other field "B" to have option associated based on input in "A".
    It seems that it will be a perfect match.
    Thanks in advance.
    Regards
    Toms

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    The following macro should give you the idea. This macro should be run by attaching it to the OnExit property for the first dropdown list. This is a quick and dirty that will wipe your selection in field two everytime you exit field one. Perhaps you need something more elegant to check whether field one was changed first because it will get annoying for multiple revisits of that field.
    <pre>Sub PopFormField()
    With ActiveDocument.FormFields("Dropdown2").DropDown.Li stEntries
    .Clear
    .Add Name:="Select one..."
    Select Case ActiveDocument.FormFields("Dropdown1").Result
    Case "North"
    .Add Name:="Cairns"
    .Add Name:="Darwin"
    .Add Name:="Townsville"
    Case "South"
    .Add Name:="Melbourne"
    .Add Name:="Hobart"
    .Add Name:="Devonport"
    Case "East"
    .Add Name:="Byron Bay"
    .Add Name:="Ballina"
    .Add Name:="Bexhill"
    Case "West"
    .Add Name:="Perth"
    .Add Name:="Henderson"
    .Add Name:="Albany"
    End Select
    End With
    ActiveDocument.FormFields("Dropdown2").Result = "Select one..."
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    New Lounger
    Join Date
    Aug 2002
    Location
    Chicago, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-down Box (Forms Toolbar) (Word 2K)

    Hi,
    and thanks Andrew this will do the job.
    Toms

Posting Permissions

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