irishmanjb
asked on
Grey out drop down menus when one is selected
I have a form in Access that has three drop down boxes with variaous information.
When the user selects any one of the drop down menus and drills down to the selection they want I want to grey out the other 2 drop down menus.
How can I do this?
Thanks
When the user selects any one of the drop down menus and drills down to the selection they want I want to grey out the other 2 drop down menus.
How can I do this?
Thanks
ASKER
How do I apply this?
Thanks
Thanks
ASKER
I am assuming that I put in the afterupdate field.
One question if someone wanted to go back and change the selection after it was greyed out how can they do that?
Thanks
One question if someone wanted to go back and change the selection after it was greyed out how can they do that?
Thanks
You can add that to your Visual Basic code. If you haven't used VB before, I can walk you through it.
What to do if a user wants to change a selection is up to you. My first thought would be to include a "reset" or "clear" button that clears the selection and un-grays the three combo boxes.
(also in VB)
Private Sub ResetButton_OnClick()
combo1.Enabled = True
combo2.Enabled = True
combo3.Enabled = True
Exit Sub
What to do if a user wants to change a selection is up to you. My first thought would be to include a "reset" or "clear" button that clears the selection and un-grays the three combo boxes.
(also in VB)
Private Sub ResetButton_OnClick()
combo1.Enabled = True
combo2.Enabled = True
combo3.Enabled = True
Exit Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much we are trying the updates now.
John
John
ASKER
Thanks it worked!
Not a problem. Glad I could help!
Assuming your combo boxes are named combo1, combo2, and combo 3, start with this:
Private Sub combo1_AfterUpdate()
combo2.Enabled = False
combo3.Enabled = False
End Sub
This will gray out combo2 and combo3 as soon as something is selected in combo1. You'll of course have to add Subs for combo2 and combo3 as well. To "un-gray out" a combo box, use "combo2.Enabled = True"