Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active Control .Dropdown

Status
Not open for further replies.

Survane

MIS
Jul 3, 2002
74
US
This my code:

Dim ctl As Control
Set ctl = Screen.ActiveControl
If ctl.ControlType = acComboBox Then
ctl.Dropdown
End If

It works. I just don't want to put it behind every combo box ctl on my form. Where can I put it on the form (globally) so that when the user goes to a new control it will run the code and dropdown if it's a combo box?

Thanks
 
Using regular Access I believe you need to put it behind every control. I'm fairly sure a Windows programmer looking for messages could implement this but then that's three steps above.

Sub ControlName_GotFocus
DrowDownComboBox
End Sub

Public Sub DropDownComboBox(ComboControl As ComboBox)
ComboControl.Dropdown
End Sub

----------------------
scking@arinc.com
Life is filled with lessons.
We are responsible for the
results of the quizzes.
-----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top