Associate
- Joined
- 21 Jun 2004
- Posts
- 1,635
Hi, Im building a database form for a hospital audit and for part of that I wanted to have users click a box to open extra boxes to put in further information. This is the first database/form system I've used and first time I've used Access & VB so go easy on me ![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
At the moment I can get the 2 text boxes to remain hidden until a command button or checkbox is clicked. I was wondering how to code so that if the check box is unticked the options would become hidden once again. I've been playing around with the IF command trying to use the value of the check box as equal to true or false, but with no luck. Is there an easy command that I`m missing or is it a limitation of VB?
My best effort at present is:
Private Sub Check159_Click()
If Me.Check159 = True Then
Me.Combo154.Visible = True
Me.Text151.Visible = True
Else
If Me.Check159 = False Then
Me.Combo154.Visible = False
Me.Text151.Visible = False
End If
End Sub
Which doesnt work in the slightest and has lost the initial reveal that I had previously. Any help would be most appreciated!
Thanks
![Smile :) :)](/styles/default/xenforo/vbSmilies/Normal/smile.gif)
At the moment I can get the 2 text boxes to remain hidden until a command button or checkbox is clicked. I was wondering how to code so that if the check box is unticked the options would become hidden once again. I've been playing around with the IF command trying to use the value of the check box as equal to true or false, but with no luck. Is there an easy command that I`m missing or is it a limitation of VB?
My best effort at present is:
Private Sub Check159_Click()
If Me.Check159 = True Then
Me.Combo154.Visible = True
Me.Text151.Visible = True
Else
If Me.Check159 = False Then
Me.Combo154.Visible = False
Me.Text151.Visible = False
End If
End Sub
Which doesnt work in the slightest and has lost the initial reveal that I had previously. Any help would be most appreciated!
Thanks