**ComboBox Values**

MS_Access_Amature

Registered User.
Local time
Today, 15:11
Joined
Nov 10, 2010
Messages
56
I have a ComboBox with a ValueList ("Employee1";"Employee2") and Button1

How do you disable Button1 only when Employee1 is selected from the ComboBox??
 
Try the following code:

Code:
Private Sub Combobox1_AfterUpdate()
Button1.visible=false
End Sub
 
That hides the button when either employee is selected.
 
Try it:

Code:
Private Sub Combobox1_AfterUpdate()
if combobox1.value="Employee1" then
Button1.visible=false
end if
End Sub
 
If Me![ComboBox].Column(0) = "Employee1" Then
Me![Button].Enabled = False
Else
Me![Button].Enabled = True
End If
 
If you want the button grayed out but still visible, try:

Private Sub Combobox1_AfterUpdate()
If Me.combobox1.value = "Employee1" Then
Me.Button1.Enabled = False
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom