Load list box after form load

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a search form with a text box for the search criteria and list box
displaying a query which is requeried and made visible after the search
button has been clicked. At the moment it takes ages for the form to open as
it has to load all the records in the database because there's no search
criteria. Is there a way to make the list box pull it's first lot of data
only after the search button has been clicked?
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK
(I have no access to other sites apart from microsoft.com so posting
external links is no use to me)
 
Sure. Leave the listbox's RowSource blank, and set it once you know what it
should be.
 
In the Design View of the Form, leave the RowSource Property of the ListBox
blank, i.e. no RowSource Query / SQL is assigned and assign this by code at
appropriate time (i.e. Event) by code.

Check Access VB Help on the RowSource Property of a ListBox.
 
Excellent. Works like a charm. Thanks Douglas and Happy New Year!
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK
(I have no access to other sites apart from microsoft.com so posting
external links is no use to me)
 
Back
Top