-
I am using a check box to toggle a text box's visible state from tru to false. This is what I have:
Private Sub chk1_Click()
If chk1.Enabled = True Then
Text3.Visible = True
Else
chk1.Enabled = False
Text3.Visible = False
End If
End Sub
When the program starts, Text3 is hidden as it should be. When you check the box, Text3 appears as it should. But when you uncheck the box, Text3 does not dissappear as it should. What didn't I do?
Thank You.
-
I believe with Check Boxes You must
use '0' , '1' instead of true and false.
I think checkboxes check for integers.
So
if chk1 = 0 then
yack yack
else
if chk1 =1 then
yack yack.
end if.
-
That was it! Thank you.
Yack.
-
-
Well ...
Try this:
Code:
Private Sub Check1_Click()
Text1.Visible = Check1.Value
End Sub
-
To make life easier, how about this simple little method? :rolleyes:
Code:
Private Sub Check1_Click()
Text3.Visible = Not Text3.Visible
End Sub
-
-
Code:
If Check1.Value = vbChecked Then Text1.Visible = True Else Text1.Visible = False