Quick Find: Search for:
Free Resources
from FMS
 

Demos

Email Newsletter

Technical Papers

Tips and Techniques

Links

Book Recommendations

View all FMS products for Microsoft AccessMicrosoft Access Resource Center

 

 

"Thank you! Thank you!
I just finished reading this
document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.
" 
- Darren D.
 
  

 

Selecting the First Item in Your ListBox

 

Provided by: Steve Clark, Senior Project Manager

 

A user often wants to see something in a list box already selected when a specific form opens or an item is selected from another location. You can programmatically select the first item in the list in order to accomplish this.

 

For a Single-Select Listbox, to automatically select the first value, use the following code:

    If IsNull(lstBox) Then
      lstBox = lstBox.ItemData(0)
    End


If The IsNull() checks that something else is not already selected, to prevent changes to a value previously selected by the user.

Return to the tips page.

Questions  l   Web questions: Webmaster   l   Copyright © 2008 FMS, Inc.

Celebrating 21 Years of Software Excellence