Combo Box to Disable Pending on value from previous Combo Box

J

Joy

Hi, I am new to MS Access coding and would like help on...
I have a form that I created with text fields & combo boxes. In my form I
would like Combo Box 3 to be enabled for certain values selected in Combo Box
2 and likewise if they pick other values, then Combo Box 3 becomes disabled.
Could you pls help me out... Thanks
 
J

Jeff Boyce

In the AfterUpdate event for ComboBox2, add code that enables/disables
Combobox3. One way might look like (untested):

Select Case Me!Combobox2
Case 1, 2, 3
Me!Combobox3.Enabled = True
Case Else
Me!Combobox3.Enabled = False
End Select


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Joy

Hi Jeff

Is this what the code should look like:

Select Case Me!ComboSpec2
Case "Deputy Director", "Director"
Me!ComboSpec3_1.Enabled = False
Case Else
Me!ComboSpec3_1.Enabled = True
End Select

ComboSpec3_1 does not become disabled when ComboSpec2 value selected is
Deputy Director.

Pls let me know how I can improve on this

Thx Joy
 
J

Jeff Boyce

Joy

If the combobox you are referring to is of standard construction, the first
field is hidden (width = 0) and is the rowID for the table that holds the
titles. The SECOND field probably holds the title (e.g., Director, ...).

Your code refers to the combobox, but since it doesn't specify which column,
Access uses the first.

Please post the SQL statement you are using to fill that combobox...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Joy

Hi Jeff

Bound Col is 1. There is only 1 visible col

Hope I'm making sense?

Thanks Joy
 
Top