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

Enabling/Disabling Combo boxes when a specific value is chosen

Status
Not open for further replies.

laina222

Technical User
Sep 7, 2001
172
0
0
US
Hello!
I have two combo boxes in my table/form. The first one is enabled and the second should start off disabled. The first box is a simple Yes/No selection. If the user selects "Yes", I want the next combo box to be enabled so the user can select from the three values in that combo box. If the user selects "No", I want them to be able to tab over to the combo box after the disabled one.

So my questions are:
-How do I tell Access to load a form with a specific combo box disabled?
-How do I have Access enable the second combo box if the user selects "Yes" from the first?
-How do I tell Access to tab over to the combo box AFTER the second combo box if "No" is selected from the first combo box?

Thanks in advance for anyone's help!
 
1) Go to the properties of the field that you want to
disable and in the "data" tab set "enabled" to no.


2) Go to the properties of the first combo box and in the
"event" tab click to the right and select "code
builder" and ad this code:

If Me.yourfirstcombobox = "YES" Then
Me.yoursecondcombobox.Enabled = True

Else
Me.yoursecondcombobox.Enabled = False


End If


3) Your last question I'm not sure I understand.
 
Okay, the code is perfect, but where do I use the code builder? I tried it under "Before Update" but there was an error.
(My last question is irrelevant anyways, since Access will do it automatically).
Thanks again!
 
Sorry it took so long to respond.

If you haven't figured it out already.......

use this code in the "After Update" of the first combo box


good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top