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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activate & Deactivate a Text Box...

Status
Not open for further replies.

Bradytailz

Technical User
Nov 19, 2002
2
US
Here's what I'm trying to do but need help:

Say for example I have a combo box and text box. The combo box is used to show if a person is employed or not (Yes/No), the text box is for if they choose "Yes" they type the employer name in the field.

What I'm trying to do is have the text box deactivated or "grayed out" when the form opens. If the user chooses "yes" then I want it to activate so the person can type the employer info. If "no" then I want it to stay "grayed out" and skipped when the combo box selection is made. I'm using Access 2000 if that helps.

Any help would be greatly appreciated!
Thanks
 
hi there

To disable (grey out) the textbox when the form opens, type this in the forms open event type:
[tt]
me.textbox.enabled = false
[/tt]

To enable/disable the textbox upon selection of yes/no within the combobox, type this in the after_update event on the combobox:
[tt]
me.textbox.enabled = (me.combobox = "Yes")
[/tt]


Hope this helps,
Cheers,
Dan
 
Un-freaking-believable!!!

It worked perfect.

Thanks Man!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top