Full Version: List Box Question...
UtterAccess Forums > Microsoft® Access > Access Forms
Hi Everyone...
I have a list box, a text box & a button on a form. The user can enter their own info in the textbox, or press the button to copy the selection from the listbox...
The problem is, if they click the button to copy from the listbox, it comes up as null. They have to select the list first, then click the button...
How can I have the list box select the first item in it when the form loads so that if the user wants to copy, they just have to click the button..?
Can you show us the code for the button? You might just have to add a code to select the listbox first.
If you really wanted to select the first item in the list, then you could use the On Load event of the form..........
If Me.[NameOfListBox].ListCount > 0 Then
Me.[NameOfListBox].ListIndex = 0
End If

Hope things are well for you sad.gif
If i understand you, you will just want to say on form load:
istbox.Selected(0) = True
Hi Alan,
Thanks. All is well here. How is it across the pond?
Cold and wet laugh.gif
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.