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 / Modules / DAO / VBA / February 2005

Tip: Looking for answers? Try searching our database.

If list box null

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
haggr - 19 Feb 2005 03:27 GMT
Don't over think this, because I'm  MORON.  
>On a form I have a listbox and when that listbox returns no results I would like something eles to happen.
>
>"IF IsNull (MyListBox) Then
>DoCmd.Beep
>or
>DoCmd.OpenForm "MyOtherForm"
>Else: GoHere.SetFocus
>
>I'm sure there is some simple code that I can figure out.
>MultiSelect ?
>Colunm(1) is bound
>Thanks Guys
Wayne Morgan - 19 Feb 2005 05:19 GMT
The listbox will have a "value" or be Null if it is NOT multiselect (simple
or extended). If it is multiselect, you have to go through the ItemsSelected
collection to find out which rows have been selected. This collection also
has a Count property. So, if no items are selected then the count will be
zero. This will change your If statement to

If Me.MyListBox.ItemsSelected.Count = 0 Then

Signature

Wayne Morgan
MS Access MVP

> Don't over think this, because I'm  MORON.
>>On a form I have a listbox and when that listbox returns no results I
[quoted text clipped - 10 lines]
>>Colunm(1) is bound
>>Thanks Guys
 
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.