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 / Forms Programming / December 2005

Tip: Looking for answers? Try searching our database.

Combo show list from code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 05 Dec 2005 23:05 GMT
Within code, is there a way to open a combo box list to show entries up to
the limit set similar to how Access handles NotInListEvent? This event, if
left to default where Limit to List is set to 'Yes', will put out standard
error message but then, open the current list. What code opens this list up?

Thanks.
Klatuu - 05 Dec 2005 23:19 GMT
The DropDown method:

Me.MyComboBox.DropDown

> Within code, is there a way to open a combo box list to show entries up to
> the limit set similar to how Access handles NotInListEvent? This event, if
> left to default where Limit to List is set to 'Yes', will put out standard
> error message but then, open the current list. What code opens this list up?
>
> Thanks.
Andy - 05 Dec 2005 23:29 GMT
Thanks Klatuu but I did try the Dropdown method but nothing happened - I
could still only see Combo text field (no drop down list) - The After Update
code below :-

   If Me.Combo8.ListIndex = -1 Then
       MsgBox "Name supplied is not in list"
       Me.Combo8.ForeColor = vbRed
       Me.Combo8.Dropdown
       GoTo Exit_Combo8_AfterUpdate
   Else
       Me.Combo8.ForeColor = vbBlack
   End If

...

> The DropDown method:
>
[quoted text clipped - 6 lines]
> >
> > Thanks.
Klatuu - 05 Dec 2005 23:33 GMT
Then I don't understand the question.  What are you trying to do?

> Thanks Klatuu but I did try the Dropdown method but nothing happened - I
> could still only see Combo text field (no drop down list) - The After Update
[quoted text clipped - 21 lines]
> > >
> > > Thanks.
Marshall Barton - 06 Dec 2005 05:18 GMT
>Thanks Klatuu but I did try the Dropdown method but nothing happened - I
>could still only see Combo text field (no drop down list) - The After Update
[quoted text clipped - 8 lines]
>        Me.Combo8.ForeColor = vbBlack
>    End If

That's because the focus is moving to another control and
the DropDown only means something while the combo box has
the focus.

Move your code to the BeforeUpdate event and add:
    Cancel = True
after the DropDown line.

Signature

Marsh
MVP [MS Access]

 
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.