Load list box after form load

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)
 
D

Douglas J. Steele

Sure. Leave the listbox's RowSource blank, and set it once you know what it
should be.
 
V

Van T. Dinh

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.
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top