Combo Box visibilty

scooteman

Registered User.
Local time
Today, 05:42
Joined
Nov 30, 2009
Messages
57
Hello,

How can I have a Combo Box be invisible when a form opens up and then only become visible after the [Employee_ID] has a value? The combo box performs an important function of out inserting the required training records based on the employee's job classification. Everything works slick unless I try to enter a job classification before entering the employee id. For some reason when I try that Access crashes, no warnings or anything, Access just crashes.
 
In Design View, set the Visibility Property of the Combobox to No in the Properties Sheet.

Then use this code, being sure to use your actual control names:
Code:
Private Sub Employee_ID_AfterUpdate()
 If Not Nz(Me.Employee_ID, "") = "" Then
  Me.ComboBoxName.Visible = True
 Else
  Me.ComboBoxName.Visible = False
 End If
End Sub
Code:
Private Sub Form_Current()
 If Not Nz(Me.Employee_ID, "") = "" Then
  Me.ComboBoxName.Visible = True
 Else
  Me.ComboBoxName.Visible = False
 End If
End Sub
 
Thanks, that worked perfect!
 

Users who are viewing this thread

Back
Top Bottom