RapidFireGT
New member
- Local time
- Yesterday, 22:41
- Joined
- Dec 5, 2011
- Messages
- 6
I’m trying to use a check-box to show/hide several input fields on a form. The names of the objects are:
Check-box: CustomerCheckBox
Input 1 field: customer_first_name
Input 2 field: customer_last_name
Input 3 field: customer_phone
*EDIT* This check-box is unbound. It does not store data in a table or have any purpose/meaning other than to simply hide/show fields in the form.
According to my Google searching, I have the proper code and I’ve tried entering it into the check-box’s events After Update and On Click, and I’ve also tried adding the code to the form’s On Current event. Here is the code I’ve used in all 3 places (it’s the same code repeated):
Strange thing is, this code worked just fine when I created a brand new blank database and tried using a check-box to show/hide a label on a form.
Any ideas why it’s not working in my populated database/form?
Check-box: CustomerCheckBox
Input 1 field: customer_first_name
Input 2 field: customer_last_name
Input 3 field: customer_phone
*EDIT* This check-box is unbound. It does not store data in a table or have any purpose/meaning other than to simply hide/show fields in the form.
According to my Google searching, I have the proper code and I’ve tried entering it into the check-box’s events After Update and On Click, and I’ve also tried adding the code to the form’s On Current event. Here is the code I’ve used in all 3 places (it’s the same code repeated):
Code:
Private Sub CustomerCheckBox_AfterUpdate()
Me.customer_first_name.Visible = (Me.CustomerCheckBox = True)
Me.customer_last_name.Visible = (Me.CustomerCheckBox = True)
Me.customer_phone.Visible = (Me.CustomerCheckBox = True)
End Sub
Code:
Private Sub CustomerCheckBox_Click()
Me.customer_first_name.Visible = (Me.CustomerCheckBox = True)
Me.customer_last_name.Visible = (Me.CustomerCheckBox = True)
Me.customer_phone.Visible = (Me.CustomerCheckBox = True)
End Sub
Code:
Private Sub Form_Current()
Me.customer_first_name.Visible = (Me.CustomerCheckBox = True)
Me.customer_last_name.Visible = (Me.CustomerCheckBox = True)
Me.customer_phone.Visible = (Me.CustomerCheckBox = True)
End Sub
Code:
Private Sub Check1_Click()
Me.Label0.Visible = (Me.Check1)
End Sub
Last edited: