R
Ron Hinds
I want the first item in a list box to be the selected item when a form
opens. The idea being that when the form opens if a user wants the first
item (usually they do) then all they have to do is hit Enter and that's the
choice that is made. I've set the default property of a command button on
the form to True, and in the Form's Current event I've set the Selected
property of the first item in the list box to True like so:
lstCutoffTime.Selected(0) = True.
But in the code of the command button, lstCutoffTime.Value always returns
Null, even though the first item in the list box is selected, as evidenced
by highlighting as well as from the Debug window. If I click that same
(already selected) item with the mouse, then the value is what I expect it
to be. What gives here?
opens. The idea being that when the form opens if a user wants the first
item (usually they do) then all they have to do is hit Enter and that's the
choice that is made. I've set the default property of a command button on
the form to True, and in the Form's Current event I've set the Selected
property of the first item in the list box to True like so:
lstCutoffTime.Selected(0) = True.
But in the code of the command button, lstCutoffTime.Value always returns
Null, even though the first item in the list box is selected, as evidenced
by highlighting as well as from the Debug window. If I click that same
(already selected) item with the mouse, then the value is what I expect it
to be. What gives here?