Version 1.1 First Published 24 Oct 2022 Approx 0.5 MB (zipped)
You can use the Dropdown property of a combobox to force it to drop down automatically when the combobox has focus.
This can both save user time and help them realise what action needs to be done next.
See the Microsoft article ComboBox Dropdown property
This approach works very well and is particularly useful with cascading combo boxes.
See my example app Cascading Comboboxes
In this example, the first combo is made to dropdown when the OK button is clicked.
After each selection, the other combos drop down in turn
A simplified version of this approach is shown in the first form of the attached example app
Click the Start button to dropdown the first combo
However, it is more difficult to achieve this effect when a form loads.
The focus needs first to be sent to a different control and then transferred to the combobox AFTER the form has finished loading.
One simple method of doing this is to use the Form_Timer event as this happens AFTER the Form_Load event
The time interval provides the short delay required. Any value greater than zero works for this purpose.
In the example app, the timer interval has been set to the minimum possible value of 1 (millisecond)
When the timer event is run, the focus is moved to the combobox and the timer interval is immediately set to 0.
This disables the timer event from running again
With both forms, selecting any value on the first combo automatically causes the second combo to dropdown
Click to download: ComboAutoDropdown_v1.1 (zipped)
All code is supplied so you can see how this approach works
Please use the contact form to let me know whether you found this article / example app useful or if you have any questions.
Colin Riddington Mendip Data Systems Last Updated 24 Oct 2022
Return to Example Databases Page
Return to Top