Lable Visible/Invisible

torquay

Registered User.
Local time
Today, 22:12
Joined
Dec 27, 2005
Messages
85
I am trying to make a label either visible or not on a report via a check box on a form but cannot seem to get it right.

Private Sub Check231_Click()
If [Check231] = -1 Then
Me![Invoice]![warrantylbl].Visible
Else
Me![Invoice]![warrantylbl].Not Visible
End If
End Sub

Any ideas what I am doing wrong

Thanks
 
Try the following code

Code:
If Check231.Value = -1 Then
      LabelName.Visible = True
Else
      LabelName.Visible = False
End If

Sorry about the double post. not sure how that happened
 
Last edited:
Can't seem to make that work as the lable is on a report called invoice and I cannot seem to get he reference correct using the following

Private Sub Check231_Click()

If Check231 = -1 Then
warrantylbl.Visible = True
Else
warrantylbl.Visible = False
End If
End Sub
 
Given that you are talking about a Report and not a form that changes the complexion of your question.

You can do a logical test in your label field, it will look something like this;

Code:
=iif ([Check231]=-1 , [field name],"")
 
I don't understand what a logical test is? and where it goes. Sorry for my ignorance.
 
An "If Then" statement is a logical test.

it needs to go in the Control Source for the Text box you wish to change. You will not be able to do this with a label, you will need to use a text box as a label for what you are trying to do.
 
Thanks, guess I did understand it after all.
I couldn't seem to make this work using a lable but could using a text box, so I suppose its not possible then using a lable is it?
Thanks
 

Users who are viewing this thread

Back
Top Bottom