Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

Access VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vbalearner - 28 Sep 2006 02:25 GMT
When I open my form I want my combo box to drop down and show the records
somewhat like a list box.
VBA code?
Larry Linson - 28 Sep 2006 03:34 GMT
> When I open my form I want my combo box
> to drop down and show the records
> somewhat like a list box.

A Combo Box's list can be dropped down only when it has the focus. So, if
you want to do this on opening the form, that will be the Control with the
focus, and the user must edit/update it first. If the user moves the cursor
to another Control, the dropdown list will close.

> VBA code?

  Me.<nameofyourcombobox>.SetFocus
  Me.<nameofyourcombobox>.Dropdown

in the OnCurrent Event of the Form.

Perhaps more useful, in the OnEnter event of your Combo Box, put

    Me.<nameofyourcombobox>.Dropdown

so the list will be dropped down when the user enters that box by tabbing to
it, or by clicking on it.

However, usually Combo Boxes have their AutoExpand property set to Yes, and
the user may expect to enter and start typing to have it scroll to the
nearest match, and may or may not desire the list to be displayed.  If you
are not the only user, it would be good to determine what the users want.

Larry Linson
Microsoft Access MVP
vbalearner - 29 Sep 2006 01:11 GMT
thanks that works great

>  > When I open my form I want my combo box
>  > to drop down and show the records
[quoted text clipped - 26 lines]
>  Larry Linson
>  Microsoft Access MVP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.