active and inactive ComboBox

Geordie2008

Registered User.
Local time
Today, 02:49
Joined
Mar 25, 2008
Messages
177
Hi all,

I have the following code which works fine and it makes 4 boxes on my form active if the Employee Status value within the form = "Inactive". so if an employee leaves the Reason_For_Leaving comboBox is available to be selected...

This works fine when I change the value within the form, e.g. go from being an "active" employee to being "inactive" employee. How do I get the same code to work based on what the value is in the form on opening?

I tried On_Load and On _Open and neither worked.....

Thanks,
Mandy



Private Sub cbo_Employee_Status_Change()

Select Case Me.cbo_Employee_Status
Case "Inactive"
Me.cbo_Inactive_Status.Enabled = True
Me.cbo_Reason_for_leaving.Enabled = True
Me.cbo_Replaced.Enabled = True
Me.txt_Replaced_by.Enabled = True
Case Else
Me.cbo_Inactive_Status.Enabled = False
Me.cbo_Reason_for_leaving.Enabled = False
Me.cbo_Replaced.Enabled = False
Me.txt_Replaced_by.Enabled = False

End Select

End Sub
 
You need to place the same code in the Form_Current event.
 
Ahh... thanks!
 

Users who are viewing this thread

Back
Top Bottom