Latest Lists

How to make the first item on the list selected on Form_Load in Access?

I have a form that has a list box that is filled with a few items. When the form opens (or loaded), I want the very first item on the list box to be selected. What's the code line I could use to make that happen? Thanks!

Public Comments

  1. Use the following lines of VBA code: List0.SetFocus List0.ListIndex = 0 This will make list-box control named "List0" the active control, and then set it to the first item in the list. To make it the second item in the list, change the =0 to a =1 value. If you want this to happen every time the form becomes active, then do this for the Form_Activate (or On Activate) property instead.
Powered by Yahoo! Answers