Summary:
Procedure allows you to programatically show or hide a combobox's dropdown list.

Arguments:
WhichCombo - a reference to the combobox
DropItDown - Boolean: True to Show list, False to Hide list
VB Code:
  1. 'declare api procedures
  2.     Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
  3.         (ByVal hwnd As Long, _
  4.         ByVal wMsg As Long, _
  5.         ByVal wParam As Long, _
  6.         lParam As Any) As Long 
  7.  
  8. 'declare constants
  9.     Public Const CB_SHOWDROPDOWN = &H14F
  10.  
  11.  
  12. Public Sub DropList(WhichCombo As Control, DropItDown As Boolean)
  13.     On Error Resume Next
  14.  
  15.     Dim vTmpLng as Long
  16.     vTmpLng = SendMessage(WhichCombo.hWnd, CB_SHOWDROPDOWN, _
  17.                   ByVal Abs(CLng(DropItDown)), ByVal CLng(0))
  18. End Sub
Usage Example:
VB Code:
  1. DropList Form1.Combo1, True
Notes:
As written, this code is intended to be placed in a module, and then called as needed. In order to place this code in a form, you will have to change the API and Constant declarations to 'Private'