How to hide fields on a form

sherimartin

New member
Local time
Yesterday, 17:27
Joined
Sep 9, 2013
Messages
6
Hi, I am trying to hide certain fields on a form based on the value in another field (if yes or no). I used the change event to enable/disable the fields in question. however, this doesn't work.
This is the code below...

Private Sub Combo314_Change()
If Me.Combo314 = "Yes" Or Me.Combo314 = "No" Then
Me.Reason_Label.Visible = False
Me.Combo316.Enabled = False
Me.Label946.Visible = False
Me.Label77.Visible = False
Me.care_not_qualified_date.Enabled = False
Else
If Me.Combo314 = "not qualifed for sample" Then
Me.Reason_Label.Visible = True
Me.Combo316.Enabled = True
Me.Label946.Visible = True
Me.Label77.Visible = True
Me.care_not_qualified_date.Enabled = True
End If
End If
End Sub
 
How does it "not work". What actually happens. Have you stepped through the code at runtime and checked the value of Me.Combo314 when the code is running.
 
I clicked on Run; A macro box appears to name the macro (CARE1). Then I click on Run/Step Into on the macro box, nothing happens. The cursor doesn't move.:confused:
 
Not sure it will work, but you could try your existing code in the After Update event of the combo box.
 

Users who are viewing this thread

Back
Top Bottom