Selecting the First Item in the ListBox on Your Microsoft Access Form
Provided by: FMS Development Team
Rather than not selecting a value for list box controls or setting a
specific default value, you can set it to the first value in the list. This
lets your list manage what's selected and will always be correct regardless
if the list of options changes.
You can
programmatically select the first item in the list by adding this code to
the form's Form_Open event.
Here's an example for a list box named lstBox:
If IsNull(Me.lstBox) Then
Me.lstBox = Me.lstBox.ItemData(0)
End If
IsNull is used to avoid setting this value if
there's an existing value.
For more details, visit
Creating Cascading Combo Boxes and List
Boxes on Microsoft
Access Forms
Resources for Microsoft Access Combo Boxes and Forms
|