Is it possible, if so how, to have the first row of a data populated listbox selected upon ‘open’? mimic a click on the row?
set the focus to the listbox.
Set the listindex to 0
(If you want the change event to fire you might set listindex to 1 then 0)
I’d wrap this line in a line checking for ListCount > 0…
In listbox open event i have this code:
List.SetFocus ListSelectedRowIndex = 1 List.SelectedRowIndex = 0
Why nothing happens and i don’t have the first item of the list selected ?
If you have it in the Open event it might not work because it may be trying before the listbox is populated and, therefore, does not have a row 0 yet. If you are populating the listbox in the open event, then you might have to set up a timer to set the SelectedRowIndex and call that from the end of the Open event.