Label Visible Problem

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

Bob

I have a listbox on my form called [listNoClient] and a label
[lableNoClient], I am trying to make the lable Invisible when the list box
is Null, and Visible when the listNoClient Not
Null.....................Thanks for any help................Bob
 
Thanks Ken, Multi Select is None.......Bob

Ken Snell (MVP) said:
What is the value of the Multiselect property of the listbox?

--

Ken Snell
<MS ACCESS MVP>


Bob said:
I have a listbox on my form called [listNoClient] and a label
[lableNoClient], I am trying to make the lable Invisible when the list
box is Null, and Visible when the listNoClient Not
Null.....................Thanks for any help................Bob
 
Hi Bob,

(Long time no speak :)

If by "Is Null" you mean when the list is empty use the ListCount property:

Me.lableNoClient.Visible= _
IIf(Me.listNoClient.ListCount=0,False,True)

If you mean nothing is selected, use the IemsSelected property:


Me.lableNoClient.Visible= _
IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)



Regards/Jacob


|
|
| I have a listbox on my form called [listNoClient] and a label
| [lableNoClient], I am trying to make the lable Invisible when the list box
| is Null, and Visible when the listNoClient Not
| Null.....................Thanks for any help................Bob
|
|
 
Good to hear from you Jacob thanks, Worked, and I did a requery for the List
Box from the form that has the Clients on, but I cant find a way to requery
a label! the code only disappears if you reboot your DB.....Thanks Bob
 
Hi Bob,

You cannot Requery a Label. What are you trying to do?

Regards/Jacob

| Good to hear from you Jacob thanks, Worked, and I did a requery for the
List
| Box from the form that has the Clients on, but I cant find a way to
requery
| a label! the code only disappears if you reboot your DB.....Thanks Bob
|
| | > Hi Bob,
| >
| > (Long time no speak :)
| >
| > If by "Is Null" you mean when the list is empty use the ListCount
| > property:
| >
| > Me.lableNoClient.Visible= _
| > IIf(Me.listNoClient.ListCount=0,False,True)
| >
| > If you mean nothing is selected, use the IemsSelected property:
| >
| >
| > Me.lableNoClient.Visible= _
| > IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)
| >
| >
| >
| > Regards/Jacob
| >
| >
| > |
| > |
| > | I have a listbox on my form called [listNoClient] and a label
| > | [lableNoClient], I am trying to make the lable Invisible when the list
| > box
| > | is Null, and Visible when the listNoClient Not
| > | Null.....................Thanks for any help................Bob
| > |
| > |
| >
| >
|
|
 
Thanks Jacob it is a warning that shows on main Menu that the Horse does not
have a Client, I have added the list box as well and its working if you
close the form Main Menu down and reopen it...Thanks Bob

Private Sub Form_Current()
Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False, True)
Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False, True)

End Sub
 
Just realized frmMain dose not actually close when you go to another form so
you cant requery the form because it is open, is that right........Thanks
Bob

Bob said:
Thanks Jacob it is a warning that shows on main Menu that the Horse does
not have a Client, I have added the list box as well and its working if
you close the form Main Menu down and reopen it...Thanks Bob

Private Sub Form_Current()
Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False, True)
Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False, True)

End Sub
JK said:
Hi Bob,

You cannot Requery a Label. What are you trying to do?

Regards/Jacob

| Good to hear from you Jacob thanks, Worked, and I did a requery for the
List
| Box from the form that has the Clients on, but I cant find a way to
requery
| a label! the code only disappears if you reboot your DB.....Thanks Bob
|
| | > Hi Bob,
| >
| > (Long time no speak :)
| >
| > If by "Is Null" you mean when the list is empty use the ListCount
| > property:
| >
| > Me.lableNoClient.Visible= _
| > IIf(Me.listNoClient.ListCount=0,False,True)
| >
| > If you mean nothing is selected, use the IemsSelected property:
| >
| >
| > Me.lableNoClient.Visible= _
| > IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)
| >
| >
| >
| > Regards/Jacob
| >
| >
| > |
| > |
| > | I have a listbox on my form called [listNoClient] and a label
| > | [lableNoClient], I am trying to make the lable Invisible when the
list
| > box
| > | is Null, and Visible when the listNoClient Not
| > | Null.....................Thanks for any help................Bob
| > |
| > |
| >
| >
|
|
 
If I get you right, you may want to re-test visibility when you return to
frmMain. In this case use the Close Event of the form/s in which you may
change data underling the list box i.e:


Private Sub Form_Close

If CurrentProject.AllForms("frmMain").IsLoaded then

Forms("frmMain")("ListNoClient").Refresh

Forms("frmMain")("LableNoClient").Visible = _
IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False, True)

Forms("frmMain")("ListNoClient)= _
IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False, True)


End If

End Sub

Regards/Jacob


| Just realized frmMain dose not actually close when you go to another form
so
| you cant requery the form because it is open, is that right........Thanks
| Bob
|
| > Thanks Jacob it is a warning that shows on main Menu that the Horse does
| > not have a Client, I have added the list box as well and its working if
| > you close the form Main Menu down and reopen it...Thanks Bob
| >
| > Private Sub Form_Current()
| > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False,
True)
| > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False,
True)
| >
| > End Sub
| > | >> Hi Bob,
| >>
| >> You cannot Requery a Label. What are you trying to do?
| >>
| >> Regards/Jacob
| >>
| >> | Good to hear from you Jacob thanks, Worked, and I did a requery for
the
| >> List
| >> | Box from the form that has the Clients on, but I cant find a way to
| >> requery
| >> | a label! the code only disappears if you reboot your DB.....Thanks
Bob
| >> |
| >> | | >> | > Hi Bob,
| >> | >
| >> | > (Long time no speak :)
| >> | >
| >> | > If by "Is Null" you mean when the list is empty use the ListCount
| >> | > property:
| >> | >
| >> | > Me.lableNoClient.Visible= _
| >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| >> | >
| >> | > If you mean nothing is selected, use the IemsSelected property:
| >> | >
| >> | >
| >> | > Me.lableNoClient.Visible= _
| >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)
| >> | >
| >> | >
| >> | >
| >> | > Regards/Jacob
| >> | >
| >> | >
| >> | >> | > |
| >> | > |
| >> | > | I have a listbox on my form called [listNoClient] and a label
| >> | > | [lableNoClient], I am trying to make the lable Invisible when the
| >> list
| >> | > box
| >> | > | is Null, and Visible when the listNoClient Not
| >> | > | Null.....................Thanks for any help................Bob
| >> | > |
| >> | > |
| >> | >
| >> | >
| >> |
| >> |
| >>
| >>
| >
| >
|
|
 
Jacob I got this error closing my form Run Time Error 438 "Object doesn't
support this property or method" I added a couple of " that you missed in
your code
Regards Bob
JK said:
If I get you right, you may want to re-test visibility when you return to
frmMain. In this case use the Close Event of the form/s in which you may
change data underling the list box i.e:


Private Sub Form_Close

If CurrentProject.AllForms("frmMain").IsLoaded then

Forms("frmMain")("ListNoClient").Refresh

Forms("frmMain")("LableNoClient").Visible = _
IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False, True)

Forms("frmMain")("ListNoClient)= _
IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False, True)


End If

End Sub

Regards/Jacob


| Just realized frmMain dose not actually close when you go to another
form
so
| you cant requery the form because it is open, is that
right........Thanks
| Bob
|
| > Thanks Jacob it is a warning that shows on main Menu that the Horse
does
| > not have a Client, I have added the list box as well and its working
if
| > you close the form Main Menu down and reopen it...Thanks Bob
| >
| > Private Sub Form_Current()
| > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False,
True)
| > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False,
True)
| >
| > End Sub
| > | >> Hi Bob,
| >>
| >> You cannot Requery a Label. What are you trying to do?
| >>
| >> Regards/Jacob
| >>
| >> | Good to hear from you Jacob thanks, Worked, and I did a requery for
the
| >> List
| >> | Box from the form that has the Clients on, but I cant find a way to
| >> requery
| >> | a label! the code only disappears if you reboot your DB.....Thanks
Bob
| >> |
| >> | | >> | > Hi Bob,
| >> | >
| >> | > (Long time no speak :)
| >> | >
| >> | > If by "Is Null" you mean when the list is empty use the ListCount
| >> | > property:
| >> | >
| >> | > Me.lableNoClient.Visible= _
| >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| >> | >
| >> | > If you mean nothing is selected, use the IemsSelected property:
| >> | >
| >> | >
| >> | > Me.lableNoClient.Visible= _
| >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)
| >> | >
| >> | >
| >> | >
| >> | > Regards/Jacob
| >> | >
| >> | >
| >> | >> | > |
| >> | > |
| >> | > | I have a listbox on my form called [listNoClient] and a label
| >> | > | [lableNoClient], I am trying to make the lable Invisible when
the
| >> list
| >> | > box
| >> | > | is Null, and Visible when the listNoClient Not
| >> | > | Null.....................Thanks for any help................Bob
| >> | > |
| >> | > |
| >> | >
| >> | >
| >> |
| >> |
| >>
| >>
| >
| >
|
|
 
Oops, sorry mate,
Also, change the "Refresh" to "Requery"

Reagards/Jacob

| Jacob I got this error closing my form Run Time Error 438 "Object doesn't
| support this property or method" I added a couple of " that you missed in
| your code
| Regards Bob
| | > If I get you right, you may want to re-test visibility when you return
to
| > frmMain. In this case use the Close Event of the form/s in which you may
| > change data underling the list box i.e:
| >
| >
| > Private Sub Form_Close
| >
| > If CurrentProject.AllForms("frmMain").IsLoaded then
| >
| > Forms("frmMain")("ListNoClient").Refresh
| >
| > Forms("frmMain")("LableNoClient").Visible = _
| > IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False,
True)
| >
| > Forms("frmMain")("ListNoClient)= _
| > IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False,
True)
| >
| >
| > End If
| >
| > End Sub
| >
| > Regards/Jacob
| >
| >
| > | Just realized frmMain dose not actually close when you go to another
| > form
| > so
| > | you cant requery the form because it is open, is that
| > right........Thanks
| > | Bob
| > |
| > | > Thanks Jacob it is a warning that shows on main Menu that the Horse
| > does
| > | > not have a Client, I have added the list box as well and its working
| > if
| > | > you close the form Main Menu down and reopen it...Thanks Bob
| > | >
| > | > Private Sub Form_Current()
| > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False,
| > True)
| > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0, False,
| > True)
| > | >
| > | > End Sub
| > | > | > | >> Hi Bob,
| > | >>
| > | >> You cannot Requery a Label. What are you trying to do?
| > | >>
| > | >> Regards/Jacob
| > | >>
| > | > | >> | Good to hear from you Jacob thanks, Worked, and I did a requery
for
| > the
| > | >> List
| > | >> | Box from the form that has the Clients on, but I cant find a way
to
| > | >> requery
| > | >> | a label! the code only disappears if you reboot your
DB.....Thanks
| > Bob
| > | >> |
| > | >> | | > | >> | > Hi Bob,
| > | >> | >
| > | >> | > (Long time no speak :)
| > | >> | >
| > | >> | > If by "Is Null" you mean when the list is empty use the
ListCount
| > | >> | > property:
| > | >> | >
| > | >> | > Me.lableNoClient.Visible= _
| > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| > | >> | >
| > | >> | > If you mean nothing is selected, use the IemsSelected property:
| > | >> | >
| > | >> | >
| > | >> | > Me.lableNoClient.Visible= _
| > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)
| > | >> | >
| > | >> | >
| > | >> | >
| > | >> | > Regards/Jacob
| > | >> | >
| > | >> | >
| > | >> | > | >> | > |
| > | >> | > |
| > | >> | > | I have a listbox on my form called [listNoClient] and a label
| > | >> | > | [lableNoClient], I am trying to make the lable Invisible when
| > the
| > | >> list
| > | >> | > box
| > | >> | > | is Null, and Visible when the listNoClient Not
| > | >> | > | Null.....................Thanks for any
help................Bob
| > | >> | > |
| > | >> | > |
| > | >> | >
| > | >> | >
| > | >> |
| > | >> |
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 
Thanks Jacob, changed to requery, now I am getting an error:
run time error 2465
VRS cant find the field 'LabelNoClient' referred to in your expression
This is copied from the Name Field: LabelNoClient
Thanks Bob


JK said:
Oops, sorry mate,
Also, change the "Refresh" to "Requery"

Reagards/Jacob

| Jacob I got this error closing my form Run Time Error 438 "Object
doesn't
| support this property or method" I added a couple of " that you missed
in
| your code
| Regards Bob
| | > If I get you right, you may want to re-test visibility when you return
to
| > frmMain. In this case use the Close Event of the form/s in which you
may
| > change data underling the list box i.e:
| >
| >
| > Private Sub Form_Close
| >
| > If CurrentProject.AllForms("frmMain").IsLoaded then
| >
| > Forms("frmMain")("ListNoClient").Refresh
| >
| > Forms("frmMain")("LableNoClient").Visible = _
| > IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False,
True)
| >
| > Forms("frmMain")("ListNoClient)= _
| > IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False,
True)
| >
| >
| > End If
| >
| > End Sub
| >
| > Regards/Jacob
| >
| >
| > | Just realized frmMain dose not actually close when you go to another
| > form
| > so
| > | you cant requery the form because it is open, is that
| > right........Thanks
| > | Bob
| > |
| > | > Thanks Jacob it is a warning that shows on main Menu that the
Horse
| > does
| > | > not have a Client, I have added the list box as well and its
working
| > if
| > | > you close the form Main Menu down and reopen it...Thanks Bob
| > | >
| > | > Private Sub Form_Current()
| > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
False,
| > True)
| > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
False,
| > True)
| > | >
| > | > End Sub
| > | > | > | >> Hi Bob,
| > | >>
| > | >> You cannot Requery a Label. What are you trying to do?
| > | >>
| > | >> Regards/Jacob
| > | >>
| > | > | >> | Good to hear from you Jacob thanks, Worked, and I did a requery
for
| > the
| > | >> List
| > | >> | Box from the form that has the Clients on, but I cant find a
way
to
| > | >> requery
| > | >> | a label! the code only disappears if you reboot your
DB.....Thanks
| > Bob
| > | >> |
| > | >> | | > | >> | > Hi Bob,
| > | >> | >
| > | >> | > (Long time no speak :)
| > | >> | >
| > | >> | > If by "Is Null" you mean when the list is empty use the
ListCount
| > | >> | > property:
| > | >> | >
| > | >> | > Me.lableNoClient.Visible= _
| > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| > | >> | >
| > | >> | > If you mean nothing is selected, use the IemsSelected
property:
| > | >> | >
| > | >> | >
| > | >> | > Me.lableNoClient.Visible= _
| > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False, True)
| > | >> | >
| > | >> | >
| > | >> | >
| > | >> | > Regards/Jacob
| > | >> | >
| > | >> | >
| > | >> | > | >> | > |
| > | >> | > |
| > | >> | > | I have a listbox on my form called [listNoClient] and a
label
| > | >> | > | [lableNoClient], I am trying to make the lable Invisible
when
| > the
| > | >> list
| > | >> | > box
| > | >> | > | is Null, and Visible when the listNoClient Not
| > | >> | > | Null.....................Thanks for any
help................Bob
| > | >> | > |
| > | >> | > |
| > | >> | >
| > | >> | >
| > | >> |
| > | >> |
| > | >>
| > | >>
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 
Hi Bob,

Looks like I'm still rusty :-(

Access is correct , LableNoClient is not a field - remove refrences to it -
if you hide a field, its associated label wil be hidden too.



Private Sub Form_Close

If CurrentProject.AllForms("frmMain").IsLoaded then

Forms("frmMain")("ListNoClient").Refresh

'*** Deleted next 2 lines *****
'Forms("frmMain")("LableNoClient").Visible = _
'IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
True)

'**** Added '.Visible' below
Forms("frmMain")("ListNoClient").Visible= _
IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False, True)


End If

End Sub


| Thanks Jacob, changed to requery, now I am getting an error:
| run time error 2465
| VRS cant find the field 'LabelNoClient' referred to in your expression
| This is copied from the Name Field: LabelNoClient
| Thanks Bob
|
|
| | > Oops, sorry mate,
| > Also, change the "Refresh" to "Requery"
| >
| > Reagards/Jacob
| >
| > | Jacob I got this error closing my form Run Time Error 438 "Object
| > doesn't
| > | support this property or method" I added a couple of " that you missed
| > in
| > | your code
| > | Regards Bob
| > | | > | > If I get you right, you may want to re-test visibility when you
return
| > to
| > | > frmMain. In this case use the Close Event of the form/s in which you
| > may
| > | > change data underling the list box i.e:
| > | >
| > | >
| > | > Private Sub Form_Close
| > | >
| > | > If CurrentProject.AllForms("frmMain").IsLoaded then
| > | >
| > | > Forms("frmMain")("ListNoClient").Refresh
| > | >
| > | > Forms("frmMain")("LableNoClient").Visible = _
| > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False,
| > True)
| > | >
| > | > Forms("frmMain")("ListNoClient)= _
| > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0, False,
| > True)
| > | >
| > | >
| > | > End If
| > | >
| > | > End Sub
| > | >
| > | > Regards/Jacob
| > | >
| > | >
| > | > | > | Just realized frmMain dose not actually close when you go to
another
| > | > form
| > | > so
| > | > | you cant requery the form because it is open, is that
| > | > right........Thanks
| > | > | Bob
| > | > |
| > | > | > | > Thanks Jacob it is a warning that shows on main Menu that the
| > Horse
| > | > does
| > | > | > not have a Client, I have added the list box as well and its
| > working
| > | > if
| > | > | > you close the form Main Menu down and reopen it...Thanks Bob
| > | > | >
| > | > | > Private Sub Form_Current()
| > | > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
| > False,
| > | > True)
| > | > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
| > False,
| > | > True)
| > | > | >
| > | > | > End Sub
| > | > | > | > | > | >> Hi Bob,
| > | > | >>
| > | > | >> You cannot Requery a Label. What are you trying to do?
| > | > | >>
| > | > | >> Regards/Jacob
| > | > | >>
| > | > | > | > | >> | Good to hear from you Jacob thanks, Worked, and I did a
requery
| > for
| > | > the
| > | > | >> List
| > | > | >> | Box from the form that has the Clients on, but I cant find a
| > way
| > to
| > | > | >> requery
| > | > | >> | a label! the code only disappears if you reboot your
| > DB.....Thanks
| > | > Bob
| > | > | >> |
| > | > | >> | | > | > | >> | > Hi Bob,
| > | > | >> | >
| > | > | >> | > (Long time no speak :)
| > | > | >> | >
| > | > | >> | > If by "Is Null" you mean when the list is empty use the
| > ListCount
| > | > | >> | > property:
| > | > | >> | >
| > | > | >> | > Me.lableNoClient.Visible= _
| > | > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| > | > | >> | >
| > | > | >> | > If you mean nothing is selected, use the IemsSelected
| > property:
| > | > | >> | >
| > | > | >> | >
| > | > | >> | > Me.lableNoClient.Visible= _
| > | > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False,
True)
| > | > | >> | >
| > | > | >> | >
| > | > | >> | >
| > | > | >> | > Regards/Jacob
| > | > | >> | >
| > | > | >> | >
| > | > | >> | > | > | >> | > |
| > | > | >> | > |
| > | > | >> | > | I have a listbox on my form called [listNoClient] and a
| > label
| > | > | >> | > | [lableNoClient], I am trying to make the lable Invisible
| > when
| > | > the
| > | > | >> list
| > | > | >> | > box
| > | > | >> | > | is Null, and Visible when the listNoClient Not
| > | > | >> | > | Null.....................Thanks for any
| > help................Bob
| > | > | >> | > |
| > | > | >> | > |
| > | > | >> | >
| > | > | >> | >
| > | > | >> |
| > | > | >> |
| > | > | >>
| > | > | >>
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | >
| > | >
| > |
| > |
| >
| >
|
|
 
Oops again :((((

..Requery not .refresh

Regrads
Jacob

| Hi Bob,
|
| Looks like I'm still rusty :-(
|
| Access is correct , LableNoClient is not a field - remove refrences to
it -
| if you hide a field, its associated label wil be hidden too.
|
|
|
| Private Sub Form_Close
|
| If CurrentProject.AllForms("frmMain").IsLoaded then
|
| Forms("frmMain")("ListNoClient").Refresh
|
| '*** Deleted next 2 lines *****
| 'Forms("frmMain")("LableNoClient").Visible = _
| 'IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
| True)
|
| '**** Added '.Visible' below
| Forms("frmMain")("ListNoClient").Visible= _
| IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
True)
|
|
| End If
|
| End Sub
|
|
|| Thanks Jacob, changed to requery, now I am getting an error:
|| run time error 2465
|| VRS cant find the field 'LabelNoClient' referred to in your expression
|| This is copied from the Name Field: LabelNoClient
|| Thanks Bob
||
||
|| || > Oops, sorry mate,
|| > Also, change the "Refresh" to "Requery"
|| >
|| > Reagards/Jacob
|| >
|| > | Jacob I got this error closing my form Run Time Error 438 "Object
|| > doesn't
|| > | support this property or method" I added a couple of " that you
missed
|| > in
|| > | your code
|| > | Regards Bob
|| > | || > | > If I get you right, you may want to re-test visibility when you
| return
|| > to
|| > | > frmMain. In this case use the Close Event of the form/s in which
you
|| > may
|| > | > change data underling the list box i.e:
|| > | >
|| > | >
|| > | > Private Sub Form_Close
|| > | >
|| > | > If CurrentProject.AllForms("frmMain").IsLoaded then
|| > | >
|| > | > Forms("frmMain")("ListNoClient").Refresh
|| > | >
|| > | > Forms("frmMain")("LableNoClient").Visible = _
|| > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
False,
|| > True)
|| > | >
|| > | > Forms("frmMain")("ListNoClient)= _
|| > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
False,
|| > True)
|| > | >
|| > | >
|| > | > End If
|| > | >
|| > | > End Sub
|| > | >
|| > | > Regards/Jacob
|| > | >
|| > | >
|| > || > | > | Just realized frmMain dose not actually close when you go to
| another
|| > | > form
|| > | > so
|| > | > | you cant requery the form because it is open, is that
|| > | > right........Thanks
|| > | > | Bob
|| > | > |
|| > || > | > | > Thanks Jacob it is a warning that shows on main Menu that the
|| > Horse
|| > | > does
|| > | > | > not have a Client, I have added the list box as well and its
|| > working
|| > | > if
|| > | > | > you close the form Main Menu down and reopen it...Thanks Bob
|| > | > | >
|| > | > | > Private Sub Form_Current()
|| > | > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
|| > False,
|| > | > True)
|| > | > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
|| > False,
|| > | > True)
|| > | > | >
|| > | > | > End Sub
|| > | > | > || > | > | >> Hi Bob,
|| > | > | >>
|| > | > | >> You cannot Requery a Label. What are you trying to do?
|| > | > | >>
|| > | > | >> Regards/Jacob
|| > | > | >>
|| > | > || > | > | >> | Good to hear from you Jacob thanks, Worked, and I did a
| requery
|| > for
|| > | > the
|| > | > | >> List
|| > | > | >> | Box from the form that has the Clients on, but I cant find a
|| > way
|| > to
|| > | > | >> requery
|| > | > | >> | a label! the code only disappears if you reboot your
|| > DB.....Thanks
|| > | > Bob
|| > | > | >> |
|| > | > | >> | || > | > | >> | > Hi Bob,
|| > | > | >> | >
|| > | > | >> | > (Long time no speak :)
|| > | > | >> | >
|| > | > | >> | > If by "Is Null" you mean when the list is empty use the
|| > ListCount
|| > | > | >> | > property:
|| > | > | >> | >
|| > | > | >> | > Me.lableNoClient.Visible= _
|| > | > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
|| > | > | >> | >
|| > | > | >> | > If you mean nothing is selected, use the IemsSelected
|| > property:
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> | > Me.lableNoClient.Visible= _
|| > | > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False,
| True)
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> | > Regards/Jacob
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> || > | > | >> | > |
|| > | > | >> | > |
|| > | > | >> | > | I have a listbox on my form called [listNoClient] and a
|| > label
|| > | > | >> | > | [lableNoClient], I am trying to make the lable Invisible
|| > when
|| > | > the
|| > | > | >> list
|| > | > | >> | > box
|| > | > | >> | > | is Null, and Visible when the listNoClient Not
|| > | > | >> | > | Null.....................Thanks for any
|| > help................Bob
|| > | > | >> | > |
|| > | > | >> | > |
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> |
|| > | > | >> |
|| > | > | >>
|| > | > | >>
|| > | > | >
|| > | > | >
|| > | > |
|| > | > |
|| > | >
|| > | >
|| > |
|| > |
|| >
|| >
||
||
|
|
 
Thanks Jacob, I worked for The list box but not the Label for the label to
appear and disappear I had to shut down the form Regards........Bob

JK said:
Oops again :((((

.Requery not .refresh

Regrads
Jacob

| Hi Bob,
|
| Looks like I'm still rusty :-(
|
| Access is correct , LableNoClient is not a field - remove refrences to
it -
| if you hide a field, its associated label wil be hidden too.
|
|
|
| Private Sub Form_Close
|
| If CurrentProject.AllForms("frmMain").IsLoaded then
|
| Forms("frmMain")("ListNoClient").Refresh
|
| '*** Deleted next 2 lines *****
| 'Forms("frmMain")("LableNoClient").Visible = _
| 'IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
| True)
|
| '**** Added '.Visible' below
| Forms("frmMain")("ListNoClient").Visible= _
| IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
True)
|
|
| End If
|
| End Sub
|
|
|| Thanks Jacob, changed to requery, now I am getting an error:
|| run time error 2465
|| VRS cant find the field 'LabelNoClient' referred to in your expression
|| This is copied from the Name Field: LabelNoClient
|| Thanks Bob
||
||
|| || > Oops, sorry mate,
|| > Also, change the "Refresh" to "Requery"
|| >
|| > Reagards/Jacob
|| >
|| > | Jacob I got this error closing my form Run Time Error 438 "Object
|| > doesn't
|| > | support this property or method" I added a couple of " that you
missed
|| > in
|| > | your code
|| > | Regards Bob
|| > | || > | > If I get you right, you may want to re-test visibility when you
| return
|| > to
|| > | > frmMain. In this case use the Close Event of the form/s in which
you
|| > may
|| > | > change data underling the list box i.e:
|| > | >
|| > | >
|| > | > Private Sub Form_Close
|| > | >
|| > | > If CurrentProject.AllForms("frmMain").IsLoaded then
|| > | >
|| > | > Forms("frmMain")("ListNoClient").Refresh
|| > | >
|| > | > Forms("frmMain")("LableNoClient").Visible = _
|| > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
False,
|| > True)
|| > | >
|| > | > Forms("frmMain")("ListNoClient)= _
|| > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
False,
|| > True)
|| > | >
|| > | >
|| > | > End If
|| > | >
|| > | > End Sub
|| > | >
|| > | > Regards/Jacob
|| > | >
|| > | >
|| > || > | > | Just realized frmMain dose not actually close when you go to
| another
|| > | > form
|| > | > so
|| > | > | you cant requery the form because it is open, is that
|| > | > right........Thanks
|| > | > | Bob
|| > | > |
|| > || > | > | > Thanks Jacob it is a warning that shows on main Menu that the
|| > Horse
|| > | > does
|| > | > | > not have a Client, I have added the list box as well and its
|| > working
|| > | > if
|| > | > | > you close the form Main Menu down and reopen it...Thanks Bob
|| > | > | >
|| > | > | > Private Sub Form_Current()
|| > | > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
|| > False,
|| > | > True)
|| > | > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount = 0,
|| > False,
|| > | > True)
|| > | > | >
|| > | > | > End Sub
|| > | > | > || > | > | >> Hi Bob,
|| > | > | >>
|| > | > | >> You cannot Requery a Label. What are you trying to do?
|| > | > | >>
|| > | > | >> Regards/Jacob
|| > | > | >>
|| > | > || > | > | >> | Good to hear from you Jacob thanks, Worked, and I did a
| requery
|| > for
|| > | > the
|| > | > | >> List
|| > | > | >> | Box from the form that has the Clients on, but I cant find
a
|| > way
|| > to
|| > | > | >> requery
|| > | > | >> | a label! the code only disappears if you reboot your
|| > DB.....Thanks
|| > | > Bob
|| > | > | >> |
|| > | > | >> | || > | > | >> | > Hi Bob,
|| > | > | >> | >
|| > | > | >> | > (Long time no speak :)
|| > | > | >> | >
|| > | > | >> | > If by "Is Null" you mean when the list is empty use the
|| > ListCount
|| > | > | >> | > property:
|| > | > | >> | >
|| > | > | >> | > Me.lableNoClient.Visible= _
|| > | > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
|| > | > | >> | >
|| > | > | >> | > If you mean nothing is selected, use the IemsSelected
|| > property:
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> | > Me.lableNoClient.Visible= _
|| > | > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False,
| True)
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> | > Regards/Jacob
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> || > | > | >> | > |
|| > | > | >> | > |
|| > | > | >> | > | I have a listbox on my form called [listNoClient] and
a
|| > label
|| > | > | >> | > | [lableNoClient], I am trying to make the lable
Invisible
|| > when
|| > | > the
|| > | > | >> list
|| > | > | >> | > box
|| > | > | >> | > | is Null, and Visible when the listNoClient Not
|| > | > | >> | > | Null.....................Thanks for any
|| > help................Bob
|| > | > | >> | > |
|| > | > | >> | > |
|| > | > | >> | >
|| > | > | >> | >
|| > | > | >> |
|| > | > | >> |
|| > | > | >>
|| > | > | >>
|| > | > | >
|| > | > | >
|| > | > |
|| > | > |
|| > | >
|| > | >
|| > |
|| > |
|| >
|| >
||
||
|
|
 
Bob,

Is the label associated with the list box? or did you create them
separately.

If You created them separately, delete them and re-create them together and
give the new ones the old control names.

Regards
Jacob

| Thanks Jacob, I worked for The list box but not the Label for the label to
| appear and disappear I had to shut down the form Regards........Bob
|
| | > Oops again :((((
| >
| > .Requery not .refresh
| >
| > Regrads
| > Jacob
| >
| > | > | Hi Bob,
| > |
| > | Looks like I'm still rusty :-(
| > |
| > | Access is correct , LableNoClient is not a field - remove refrences to
| > it -
| > | if you hide a field, its associated label wil be hidden too.
| > |
| > |
| > |
| > | Private Sub Form_Close
| > |
| > | If CurrentProject.AllForms("frmMain").IsLoaded then
| > |
| > | Forms("frmMain")("ListNoClient").Refresh
| > |
| > | '*** Deleted next 2 lines *****
| > | 'Forms("frmMain")("LableNoClient").Visible = _
| > | 'IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
| > | True)
| > |
| > | '**** Added '.Visible' below
| > | Forms("frmMain")("ListNoClient").Visible= _
| > | IIf(Forms("frmMain")("ListNoClient").ListCount = 0, False,
| > True)
| > |
| > |
| > | End If
| > |
| > | End Sub
| > |
| > |
| > || Thanks Jacob, changed to requery, now I am getting an error:
| > || run time error 2465
| > || VRS cant find the field 'LabelNoClient' referred to in your
expression
| > || This is copied from the Name Field: LabelNoClient
| > || Thanks Bob
| > ||
| > ||
| > || | > || > Oops, sorry mate,
| > || > Also, change the "Refresh" to "Requery"
| > || >
| > || > Reagards/Jacob
| > || >
| > | > || > | Jacob I got this error closing my form Run Time Error 438 "Object
| > || > doesn't
| > || > | support this property or method" I added a couple of " that you
| > missed
| > || > in
| > || > | your code
| > || > | Regards Bob
| > || > | | > || > | > If I get you right, you may want to re-test visibility when you
| > | return
| > || > to
| > || > | > frmMain. In this case use the Close Event of the form/s in
which
| > you
| > || > may
| > || > | > change data underling the list box i.e:
| > || > | >
| > || > | >
| > || > | > Private Sub Form_Close
| > || > | >
| > || > | > If CurrentProject.AllForms("frmMain").IsLoaded then
| > || > | >
| > || > | > Forms("frmMain")("ListNoClient").Refresh
| > || > | >
| > || > | > Forms("frmMain")("LableNoClient").Visible = _
| > || > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
| > False,
| > || > True)
| > || > | >
| > || > | > Forms("frmMain")("ListNoClient)= _
| > || > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
| > False,
| > || > True)
| > || > | >
| > || > | >
| > || > | > End If
| > || > | >
| > || > | > End Sub
| > || > | >
| > || > | > Regards/Jacob
| > || > | >
| > || > | >
| > || > | > || > | > | Just realized frmMain dose not actually close when you go to
| > | another
| > || > | > form
| > || > | > so
| > || > | > | you cant requery the form because it is open, is that
| > || > | > right........Thanks
| > || > | > | Bob
| > || > | > |
| > || > | > || > | > | > Thanks Jacob it is a warning that shows on main Menu that
the
| > || > Horse
| > || > | > does
| > || > | > | > not have a Client, I have added the list box as well and
its
| > || > working
| > || > | > if
| > || > | > | > you close the form Main Menu down and reopen it...Thanks
Bob
| > || > | > | >
| > || > | > | > Private Sub Form_Current()
| > || > | > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount =
0,
| > || > False,
| > || > | > True)
| > || > | > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount =
0,
| > || > False,
| > || > | > True)
| > || > | > | >
| > || > | > | > End Sub
| > || > | > | > | > || > | > | >> Hi Bob,
| > || > | > | >>
| > || > | > | >> You cannot Requery a Label. What are you trying to do?
| > || > | > | >>
| > || > | > | >> Regards/Jacob
| > || > | > | >>
| > || > | > | > || > | > | >> | Good to hear from you Jacob thanks, Worked, and I did a
| > | requery
| > || > for
| > || > | > the
| > || > | > | >> List
| > || > | > | >> | Box from the form that has the Clients on, but I cant
find
| > a
| > || > way
| > || > to
| > || > | > | >> requery
| > || > | > | >> | a label! the code only disappears if you reboot your
| > || > DB.....Thanks
| > || > | > Bob
| > || > | > | >> |
| > || > | > | >> | | > || > | > | >> | > Hi Bob,
| > || > | > | >> | >
| > || > | > | >> | > (Long time no speak :)
| > || > | > | >> | >
| > || > | > | >> | > If by "Is Null" you mean when the list is empty use
the
| > || > ListCount
| > || > | > | >> | > property:
| > || > | > | >> | >
| > || > | > | >> | > Me.lableNoClient.Visible= _
| > || > | > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| > || > | > | >> | >
| > || > | > | >> | > If you mean nothing is selected, use the IemsSelected
| > || > property:
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | > Me.lableNoClient.Visible= _
| > || > | > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0, False,
| > | True)
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | > Regards/Jacob
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | > || > | > | >> | > |
| > || > | > | >> | > |
| > || > | > | >> | > | I have a listbox on my form called [listNoClient]
and
| > a
| > || > label
| > || > | > | >> | > | [lableNoClient], I am trying to make the lable
| > Invisible
| > || > when
| > || > | > the
| > || > | > | >> list
| > || > | > | >> | > box
| > || > | > | >> | > | is Null, and Visible when the listNoClient Not
| > || > | > | >> | > | Null.....................Thanks for any
| > || > help................Bob
| > || > | > | >> | > |
| > || > | > | >> | > |
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> |
| > || > | > | >> |
| > || > | > | >>
| > || > | > | >>
| > || > | > | >
| > || > | > | >
| > || > | > |
| > || > | > |
| > || > | >
| > || > | >
| > || > |
| > || > |
| > || >
| > || >
| > ||
| > ||
| > |
| > |
| >
| >
|
|
 
JK said:
Bob,

Is the label associated with the list box? or did you create them
separately.

If You created them separately, delete them and re-create them together
and
give the new ones the old control names.


Note: to attach an unattached label to a control (such as a listbox), click
on the label, press Ctrl+x, click on the control, and press Ctrl+c.
 
Brilliant re-created the Control with its own label works
fantastic....Thanks ...Bob

JK said:
Bob,

Is the label associated with the list box? or did you create them
separately.

If You created them separately, delete them and re-create them together
and
give the new ones the old control names.

Regards
Jacob

| Thanks Jacob, I worked for The list box but not the Label for the label
to
| appear and disappear I had to shut down the form Regards........Bob
|
| | > Oops again :((((
| >
| > .Requery not .refresh
| >
| > Regrads
| > Jacob
| >
| > | > | Hi Bob,
| > |
| > | Looks like I'm still rusty :-(
| > |
| > | Access is correct , LableNoClient is not a field - remove refrences
to
| > it -
| > | if you hide a field, its associated label wil be hidden too.
| > |
| > |
| > |
| > | Private Sub Form_Close
| > |
| > | If CurrentProject.AllForms("frmMain").IsLoaded then
| > |
| > | Forms("frmMain")("ListNoClient").Refresh
| > |
| > | '*** Deleted next 2 lines *****
| > | 'Forms("frmMain")("LableNoClient").Visible = _
| > | 'IIf(Forms("frmMain")("ListNoClient").ListCount = 0,
False,
| > | True)
| > |
| > | '**** Added '.Visible' below
| > | Forms("frmMain")("ListNoClient").Visible= _
| > | IIf(Forms("frmMain")("ListNoClient").ListCount = 0,
False,
| > True)
| > |
| > |
| > | End If
| > |
| > | End Sub
| > |
| > |
| > || Thanks Jacob, changed to requery, now I am getting an error:
| > || run time error 2465
| > || VRS cant find the field 'LabelNoClient' referred to in your
expression
| > || This is copied from the Name Field: LabelNoClient
| > || Thanks Bob
| > ||
| > ||
| > || | > || > Oops, sorry mate,
| > || > Also, change the "Refresh" to "Requery"
| > || >
| > || > Reagards/Jacob
| > || >
| > | > || > | Jacob I got this error closing my form Run Time Error 438
"Object
| > || > doesn't
| > || > | support this property or method" I added a couple of " that you
| > missed
| > || > in
| > || > | your code
| > || > | Regards Bob
| > || > | | > || > | > If I get you right, you may want to re-test visibility when
you
| > | return
| > || > to
| > || > | > frmMain. In this case use the Close Event of the form/s in
which
| > you
| > || > may
| > || > | > change data underling the list box i.e:
| > || > | >
| > || > | >
| > || > | > Private Sub Form_Close
| > || > | >
| > || > | > If CurrentProject.AllForms("frmMain").IsLoaded then
| > || > | >
| > || > | > Forms("frmMain")("ListNoClient").Refresh
| > || > | >
| > || > | > Forms("frmMain")("LableNoClient").Visible = _
| > || > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
| > False,
| > || > True)
| > || > | >
| > || > | > Forms("frmMain")("ListNoClient)= _
| > || > | > IIf(Forms("frmMain")("ListNoClient).ListCount = 0,
| > False,
| > || > True)
| > || > | >
| > || > | >
| > || > | > End If
| > || > | >
| > || > | > End Sub
| > || > | >
| > || > | > Regards/Jacob
| > || > | >
| > || > | >
| > || > | > || > | > | Just realized frmMain dose not actually close when you go
to
| > | another
| > || > | > form
| > || > | > so
| > || > | > | you cant requery the form because it is open, is that
| > || > | > right........Thanks
| > || > | > | Bob
| > || > | > |
| > || > | > || > | > | > Thanks Jacob it is a warning that shows on main Menu that
the
| > || > Horse
| > || > | > does
| > || > | > | > not have a Client, I have added the list box as well and
its
| > || > working
| > || > | > if
| > || > | > | > you close the form Main Menu down and reopen it...Thanks
Bob
| > || > | > | >
| > || > | > | > Private Sub Form_Current()
| > || > | > | > Me.LabelNoClient.Visible = IIf(Me.ListNoClient.ListCount
=
0,
| > || > False,
| > || > | > True)
| > || > | > | > Me.ListNoClient.Visible = IIf(Me.ListNoClient.ListCount =
0,
| > || > False,
| > || > | > True)
| > || > | > | >
| > || > | > | > End Sub
| > || > | > | > | > || > | > | >> Hi Bob,
| > || > | > | >>
| > || > | > | >> You cannot Requery a Label. What are you trying to do?
| > || > | > | >>
| > || > | > | >> Regards/Jacob
| > || > | > | >>
| > || > | > | > || > | > | >> | Good to hear from you Jacob thanks, Worked, and I did
a
| > | requery
| > || > for
| > || > | > the
| > || > | > | >> List
| > || > | > | >> | Box from the form that has the Clients on, but I cant
find
| > a
| > || > way
| > || > to
| > || > | > | >> requery
| > || > | > | >> | a label! the code only disappears if you reboot your
| > || > DB.....Thanks
| > || > | > Bob
| > || > | > | >> |
| > || > | > | >> | | > || > | > | >> | > Hi Bob,
| > || > | > | >> | >
| > || > | > | >> | > (Long time no speak :)
| > || > | > | >> | >
| > || > | > | >> | > If by "Is Null" you mean when the list is empty use
the
| > || > ListCount
| > || > | > | >> | > property:
| > || > | > | >> | >
| > || > | > | >> | > Me.lableNoClient.Visible= _
| > || > | > | >> | > IIf(Me.listNoClient.ListCount=0,False,True)
| > || > | > | >> | >
| > || > | > | >> | > If you mean nothing is selected, use the
IemsSelected
| > || > property:
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | > Me.lableNoClient.Visible= _
| > || > | > | >> | > IIf(Me.listNoClient.ItemsSelected.Count = 0,
False,
| > | True)
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | > Regards/Jacob
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> | > || > | > | >> | > |
| > || > | > | >> | > |
| > || > | > | >> | > | I have a listbox on my form called [listNoClient]
and
| > a
| > || > label
| > || > | > | >> | > | [lableNoClient], I am trying to make the lable
| > Invisible
| > || > when
| > || > | > the
| > || > | > | >> list
| > || > | > | >> | > box
| > || > | > | >> | > | is Null, and Visible when the listNoClient Not
| > || > | > | >> | > | Null.....................Thanks for any
| > || > help................Bob
| > || > | > | >> | > |
| > || > | > | >> | > |
| > || > | > | >> | >
| > || > | > | >> | >
| > || > | > | >> |
| > || > | > | >> |
| > || > | > | >>
| > || > | > | >>
| > || > | > | >
| > || > | > | >
| > || > | > |
| > || > | > |
| > || > | >
| > || > | >
| > || > |
| > || > |
| > || >
| > || >
| > ||
| > ||
| > |
| > |
| >
| >
|
|
 
Thanks Ken,

I was looking for a way to do that for years.

Regards
Jacob


| | > Bob,
| >
| > Is the label associated with the list box? or did you create them
| > separately.
| >
| > If You created them separately, delete them and re-create them together
| > and
| > give the new ones the old control names.
| >
|
|
| Note: to attach an unattached label to a control (such as a listbox),
click
| on the label, press Ctrl+x, click on the control, and press Ctrl+c.
| --
|
| Ken Snell
| <MS ACCESS MVP>
|
|
|
 

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


Back
Top