PDA

View Full Version : Word 2000 dropdown fields



skromni
09-15-2006, 11:17 AM
Help!!!!: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.

:banghead:

Thanks in advance.

fumei
09-15-2006, 12:04 PM
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.

skromni
09-15-2006, 02:46 PM
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.

fumei
09-17-2006, 04:58 PM
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.

skromni
09-17-2006, 07:16 PM
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.

fumei
09-19-2006, 01:47 PM
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
OtherIf ActiveDocument.FormFields("Dropdown1").DropDown _
.Value = 3 Then
TextBox1.Enabled = False
Else
TextBox1.Enabled = True
End IfPlease 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.

fumei
09-19-2006, 01:49 PM
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.

skromni
09-19-2006, 02:21 PM
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.

skromni
09-19-2006, 03:26 PM
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.

fumei
09-19-2006, 04:09 PM
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.

skromni
09-19-2006, 04:52 PM
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.

fumei
09-20-2006, 12:02 AM
You are welcome. It COULD still be done with a Label, or a textbox.