Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make corresponding text box enabled/disabled based on selection?

Status
Not open for further replies.

Kurtosdf

Programmer
Jan 17, 2001
32
US
I have a combo box with a list of options to choose. If the option is not there they can choose "other". If other is choosen then I would like a text box next to it be abled so they can input what other is. Otherwise, the other box should be disabled unless other is selected.

Any help?

Thanks
Kurto
 
if you VBA you could do the following on the comboBox's AfterUpdate event try...

Private Sub MyComboBox_AfterUpdate()
Me.MyTextBox.Enabled = False
If Me.MyComboBox = "Other" Then Me.MyTextBox.Enabled = True
End Sub

let me know if this helps
 
That definetly helped and worked - Thanks.

Now my problem is getting that info to update correctly. I have made a dummy text box that is my control source for the field. The combo and "other" text box (depending on which is selected) dump the value into my dummy text box. Logically this sounds like it would work but it is not. I am using a value list to populate my combo & I think that is the problem?
 
i'm not certian that i got the 2nd post.

you've got the following (depending on "other" selection)

Combox-------|
|-------> DummyTextbox
OtherText----|

if this is correct then ... when i do something like this i skip the control source thing & update dummyTextbox from the Combobox or OtherText's afterUpdate event. for me it's the most direct way of getting things done

but maybe i misunderstand

anyway...

i should tell you that you could skip the otherText box altogether because you don't have to limit selections to what's on the drop down list... it's a textbox/dropDownListbox combo... so users either type their selection or choose from the list all in one control
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top