Not Show a label Problem

B

Bob Vance

Just cant get ckbNoDate to not show when ckbDate= False
Thanks for any help...........Bob

Private Sub ckbDate_AfterUpdate()
Me.Requery
If ckbDate.value = True Then
lblShowdate.Visible = True

Else
lblShowdate.Visible = False

If ckbDate.value = False Then
lblNoDate.Visible = True

Else
lblNoDate.Visible = False
End If
End If
End Sub
 
J

Jeanette Cunningham

Hi Bob,
Usually, if you hide a control, its attached label is hidden too.
You can reset checkbox and both labels by setting them all to visible = true
on the property dialog.
Try running the form again after you have reset the visible properties, and
if necessary check the visible property of an attached label when the
checkbox is hidden to see what access is doing.

One method I use is to use the same label for both conditions and just
change the label's caption.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
B

Bob Larson

Bob:

1. Get rid of Me.Requery

2. Change the code to this:

Private Sub ckbDate_AfterUpdate()

lblShowdate.Visible = ckbDate

lblNoDate.Visible = Not ckbDate

End Sub


And then you need to put it on the form's On Current event as well.
--

Thanks,

Bob Larson
Access MVP

Free Access Tutorials and Resources: http://www.btabdevelopment.com
 
B

Bob Vance

Thanks Bob, but lblNoDate is just staying Visible but ShowDate is working
Thanks Bob Vance
 
Top