Hey guys,
Having some trouble getting a VERY SIMPLE if statement to work.
I have a checkbox, if it's checked when my form loads, i want a rectangle to be visible. If it's not checked, do nithing. If I check it when using the form, make the rectangle visible.
The latter part I can do with chkCheckBox_Click().
But when my form loads, my if statement won't work.
But if i tell my form to make the rectangle visible outside of the if statement - it works.
Here is what I've got now:
Private Sub Form_Load()
If chkCheckBox = Checked Then
rctRectangle.Visible = True
Else
rctRectangle.Visible = False
End If
End Sub
I have also tried:
If chkCheckBox.Value = 1
If chkCheckBox.Value = True
If chkCheckBox = 1
If chkCheckBox = True
But thus far none have worked.
Can anyone point me in the right direction? From all the VBA examples I have seen, what I've got should be working!!!
Having some trouble getting a VERY SIMPLE if statement to work.
I have a checkbox, if it's checked when my form loads, i want a rectangle to be visible. If it's not checked, do nithing. If I check it when using the form, make the rectangle visible.
The latter part I can do with chkCheckBox_Click().
But when my form loads, my if statement won't work.
But if i tell my form to make the rectangle visible outside of the if statement - it works.
Here is what I've got now:
Private Sub Form_Load()
If chkCheckBox = Checked Then
rctRectangle.Visible = True
Else
rctRectangle.Visible = False
End If
End Sub
I have also tried:
If chkCheckBox.Value = 1
If chkCheckBox.Value = True
If chkCheckBox = 1
If chkCheckBox = True
But thus far none have worked.
Can anyone point me in the right direction? From all the VBA examples I have seen, what I've got should be working!!!