Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2005

Tip: Looking for answers? Try searching our database.

Determine if listbox is empty

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
george - 18 Jan 2005 16:57 GMT
Hi to all and thanks for the support,

I have a list box with family names. When the user clicks
on a name another form opens, FamilyMembers, showing all
the family members. This works fine.

Now I would like to add a button next to the list box with
the following behaviour: If there is even one record in
the list box the button will be inactive. If there are no
records in the list box the button becomes active and
opens the FamilyMembers form to a new record. How can I
count the records in the listbox?

Any help will be greatly appreciated
.
Marshall Barton - 18 Jan 2005 17:41 GMT
>I have a list box with family names. When the user clicks
>on a name another form opens, FamilyMembers, showing all
[quoted text clipped - 6 lines]
>opens the FamilyMembers form to a new record. How can I
>count the records in the listbox?

Use the ListCount property.

Signature

Marsh
MVP [MS Access]

george - 18 Jan 2005 19:36 GMT
Marsh
thanks for your reply, can you please give me a simple
example of this property? My list box is on a tab page
thanks george

>-----Original Message-----
>>I have a list box with family names. When the user clicks
[quoted text clipped - 9 lines]
>
>Use the ListCount property.
Marshall Barton - 19 Jan 2005 00:17 GMT
It may depends on the context of what/where you're trying to
do.  The general idea is:

    If Me.thelistbox.ListCount > 0 Then
        'there's something in the list
    Else
        'the list is empty
    End If
Signature

Marsh
MVP [MS Access]

>thanks for your reply, can you please give me a simple
>example of this property? My list box is on a tab page
[quoted text clipped - 16 lines]
>>
>>Use the ListCount property.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.