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.

Setting Values List for ListBox Control (VBA)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 15 Dec 2005 22:14 GMT
Hi Guys.

Let me give you a quick rundown of what I am doing...

Basically, the Form_Load function populates a ListBox with values as the
form loads up. These values are correct and appear in the listbox without any
problems.

However, another event (for a ComboBox, after update) requires that the
values be refilled for the ListBox.

When I print out (i.e. Debug.Print) what the string of values looks
like...it is correct. However, the updated values NEVER show up in the actual
ListBox until I close it and reopen the form.

Can anyone provide assistance?

Thanks in advance, this has been troubling me all afternoon.

David
JethroUK© - 15 Dec 2005 22:46 GMT
MyListbox.Requery

> Hi Guys.
>
[quoted text clipped - 16 lines]
>
> David
JethroUK© - 16 Dec 2005 22:59 GMT
basically you need to 'requery' the list box if the list has changed

if this is as a result of a combo changing, then the obvious choice is to do
it in the combo after update event:

sub combo after update

mylistbox.requery

end sub

> MyListbox.Requery
>
[quoted text clipped - 20 lines]
> >
> > David
mscertified - 15 Dec 2005 22:54 GMT
You need a VB function to load the listbox, you call the function whenever
the data changes.
Your listbox rowsource becomes the function name
Its all explained in Access Help. Type in 'Listbox'.

-Dorian

> Hi Guys.
>
[quoted text clipped - 16 lines]
>
> David
 
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.