Using MS Access/Stop listbox losing focus
I have a listbox on the form to show a number of projects I have in the database. After click on one of the projects, I could go to other forms by click on command button to check details of the project. However, when I come back to the form with the listbox, the listbox will lose its focus. So I need to click on the project again, then go to other forms.Is there a way that could make the focus stay on the project I chosen, unless I click on another project. Thank you!
Do you mean focus on the control or for the control to retain its value? A control will retain its value until the form is closed or its changed. So, if you return to the form with the listbox, the selected value should not have changed.
If you want to place focus back int he control, you can use the On Activate event to SetFocus to the listbox.
Hope this helps,
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA