ACC: How to Open a Combo Box AutomaticallyID: Q98225
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you are entering a large amount of data and want to open a combo
box, it is inconvenient to have to press additional keys or stop to
use the pointer. This article presents a generic macro that opens a combo
box when you set the focus on the control by pressing the TAB key.
In Microsoft Access 7.0 and 97, you can use the Dropdown method to force
the list in the specified combo box to drop down. If the specified combo
box control does not have the focus, an error occurs. Using this method is
identical to pressing the F4 key when the control has the focus.
A macro with a single action, SendKeys, is shown below. You can use this
macro for all combo boxes on your form:
Action
--------
SendKeys
Actions Arguments
------------------
Keystrokes: %{DOWN}
Wait: Yes
Private Sub Employees_GotFocus()
Me!ComboBoxName.Dropdown
End Sub
For more information about the Dropdown method, search the Help Index for
"Dropdown method," or ask the Microsoft Access 97 Office Assistant.
For more information about automatically sending keystrokes, search the
Help Index for "SendKeys," or ask the Microsoft Access 97 Office Assistant.
Additional query words: send keys
Keywords : kbusage FmsCmbo
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 23, 1999