Label Visible on Condition!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

Is it possible to have a Visible Condition on a Label on a form, that is
subject to a List box on another form having data in it
Thanks for any help........Bob
 
Is it possible to have a Visible Condition on a Label on a form, that is
subject to a List box on another form having data in it
Thanks for any help........Bob

You haven't indicated what the List Box data should be.
Me.LabelName.Visible = forms!formName.ListBox = ?

The other form must also be open at the time.
 
Well I've got this far: On my from
lbWarning is the ListBox. and lblWarning is my Label
If there is any data in lbWarning I want lblWarning to be Visible, the >0
was a guess!

Private Sub Form_Open(Cancel As Integer)
If Me.lbWarning > 0 Then
Me.lblWarning.Visible = True
Else
Me.lblWarning.Visible = False
End If

End Sub
 
Fred, I copied the list box on the same form and I will make it not
Visible....Thanks...bob
 
Well I've got this far: On my from
lbWarning is the ListBox. and lblWarning is my Label
If there is any data in lbWarning I want lblWarning to be Visible, the >0
was a guess!

Private Sub Form_Open(Cancel As Integer)
If Me.lbWarning > 0 Then
Me.lblWarning.Visible = True
Else
Me.lblWarning.Visible = False
End If

End Sub

When you say "any data in lbWarning " do you mean a value in the list
box has been selected?

Me!lblWarning.Visible = Not IsNull(Me![lbWarning])

Place the above code in the Form's Current event as well as in the
lbWarning AfterUpdate event. You do not need it in the Form's Open
event.
 
Thanks Got it ;-))).........Bob

Private Sub Form_Current()
If Me.lbWarning = "SomeValue" Then
Me.lblWarning.Visible = False
Else
Me.lblWarning.Visible = True
End If

End Sub
 
Oops I can get lblWarning to disappear but I cant get it Visible
again...Thanks Bob
Yes fred any text in my listbox

fredg said:
Well I've got this far: On my from
lbWarning is the ListBox. and lblWarning is my Label
If there is any data in lbWarning I want lblWarning to be Visible, the >0
was a guess!

Private Sub Form_Open(Cancel As Integer)
If Me.lbWarning > 0 Then
Me.lblWarning.Visible = True
Else
Me.lblWarning.Visible = False
End If

End Sub

When you say "any data in lbWarning " do you mean a value in the list
box has been selected?

Me!lblWarning.Visible = Not IsNull(Me![lbWarning])

Place the above code in the Form's Current event as well as in the
lbWarning AfterUpdate event. You do not need it in the Form's Open
event.
 
This Code gets both to go Invisible but I cant seem to get them back to
Visible...Thanks bob
If IsNull(Me.lbWarning) Then
Me.lbWarning.Visible = False
Else
Me.lbWarning.Visible = True
End If
If IsNull(Me.lbWarning) Then
Me.lblWarning.Visible = False
Else
Me.lblWarning.Visible = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Visible Condition on a Label 10
Label Visible Problem 23
Make a label visible with if statement 3
Getting a label to Requery! 7
Visible Question 2
Label Visible if ! 3
Form question 1
Make text boxes visible 1

Back
Top