Consulting

Results 1 to 12 of 12

Thread: Word 2000 dropdown fields

  1. #1
    VBAX Regular
    Joined
    Sep 2006
    Posts
    6
    Location

    Word 2000 dropdown fields

    Help!!!!

    I have a Word 2000 document that contains a dropdown field (Dropdown1). The dropdown has 'Item1', 'Item2', 'Other'. I also have a text box(TextBox1) in this document. I need the TextBox1 text box enabled if the dropdowns 'Other' is selected. For all other options (Item1 and Item2), I need the dropdown disabled, so that the user cannot type anything in this box.

    Any help is appreciated.



    Thanks in advance.

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Please clarify if you are using FormFields, or ActiveX controls. You appear to be using the default names - which BTW is not a good idea.

    TextBox1 is the default name for an ActiveX textbox.
    Text1 is the default name for a FormField textbox.

    Doing what you ask is not difficult, but it different depending on whether you are using ActiveX controls, or FormFields. It seems you are using ActiveX, but I want to make sure.

    Thanks.

  3. #3
    VBAX Regular
    Joined
    Sep 2006
    Posts
    6
    Location
    Thanks for your response.

    The names are just an example of the fields that I'm using. I am changing the defaults. Also, they are ActiveX controls on the form.

    If there is an easier or a quicker way of doing this in Word2000?

    Thanks again.

  4. #4
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Sorry, but I am going to have to repeat my question.

    Please state EXACTLY what these are.

    Dropdown1 - this is a FORMFIELD name
    Textbox1 - this is an ActiveX name.

    As it stands, it sounds like you may be using both ActiveX and formfields. I doubt this is correct - although it may be. So again...WHAT are you using?

    As soon as you clear that up, it will not take long to get it doing what you want.

  5. #5
    VBAX Regular
    Joined
    Sep 2006
    Posts
    6
    Location

    Word 2000 dropdown

    Thanks again for your reply.

    I am currently using a Form Filed for the dropdown and an ActiveX text box, as you've stated. I've also tried doing the same thing with a Combo Box, which again I was unsuccessfull.

    So, to be clear, I need a text box to appear and show pre-typed text on my doc when one of the dropdown fileds is selected ("Other") and have the same text field disabled and blank when the other two selctions are selected from the dropdown.

    Hope I explained myself.

    Thanks for your help.

  6. #6
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Ok, it seems a bit strange to me, using a formfield dropdown, and an ActiveX textbox, but this will do it.

    ASSUMPTIONS:

    1. The formfield is a dropdown named Dropdown1
    2. The ActiveX is a textbox named Textbox1.
    3. The formfield has THREE items in it, this order:
    Item 1
    Item 2
    Other[vba]If ActiveDocument.FormFields("Dropdown1").DropDown _
    .Value = 3 Then
    TextBox1.Enabled = False
    Else
    TextBox1.Enabled = True
    End If[/vba]Please note that Dropdown.value is NOT the text "Other". It is the index number. It is the third item on the list - whatEVER that is.

  7. #7
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    Also please note that the above code does not clear out any previous text that had been put in the ActiveX control. This of course could be done, and probably should be.

  8. #8
    VBAX Regular
    Joined
    Sep 2006
    Posts
    6
    Location
    Thank you very much Gerry. That worked.

    Would it be better to use a label instead of a textbox if I have a pre-typed text that I want to either show or not show at all when the 'Other' option is selected from the dropdown? And if so, what would be the correct way in VBA.

    Thanks again.

  9. #9
    VBAX Regular
    Joined
    Sep 2006
    Posts
    6
    Location
    I apologize. Maybe I am not explaining what I need to do very well.

    I need to have a dropdown (either FormField or ActiveX) that has Item1, Item2, and Other. I also have a text or label filed with a sentence typed in as a default. When the 'Other' is selected from the dropdown, I need the text (the sentence that I have in a text or label) to show completely. When any other option is selected from the dropdown, I need the text with the sentence to not show at all.

    I dont need to ENABLE or DISABLE the text or laber field. I need it to show or not to show at all.

    I am still killing myself over this. Any help is appreciated. This is all done in Word 2000.

    Thank you for your help.

  10. #10
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    You used the word "disable". I can not read minds. Disable means...disable.

    You can not make the textbox visible, or invisible. There is no visible property.

    Further, you did not mention a default text.

    Ok...whatever. I am proposing an alternative. using a bookmark. I am attaching a file.

    There is a dropdown formfield. Now, the document IS protected for forms, to make the formfields work. So you MUST Tab out from the dropdown. Just selecting a choice will not do anything. You MUST Tab out.

    What this does:

    If the dropdown is "Item 1", or "Item 2", then the bookmark text is nothing. If the dropdown is "Other" then the bookmark text is "this is the text for OTHER".

    Just to try and cover the default text - which you did not mention, and do not say if it is different from what you want for Other.....I will put in default text. I am going to make it different from what "Other" will be.

    Please try and walk through what you want step-by-step. It really helps.

  11. #11
    VBAX Regular
    Joined
    Sep 2006
    Posts
    6
    Location
    This does exactly what I need. I apologize for the misunderstanding. Trying to disable the text and label properties is where I screwed up myself.

    Thanks for all your help.

  12. #12
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    You are welcome. It COULD still be done with a Label, or a textbox.

Posting Permissions

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