Query doesn't finish before ListBox displays it.

  • Thread starter Thread starter Morris.C
  • Start date Start date
M

Morris.C

I have a query, that if opened on its own, takes approximately five seconds
to complete.
The problem is that I have a ListBox based on this query, that seems to
display the list before the query has finished.
The effect of this is that if you scroll down the list a page at a time,
the list ends before it should. ie. It doesn't display the complete list.

Is there a way to get the ListBox to display the list only when the query
behind it has finished?
 
Here is some information from Sensei Stephen Lebans on this subject which should help:

' Begin Quote

It is a case of the Access GUI not knowing how many
rows will be returned by the Rowsource behind the control. To correct
this behaviour we need the force Access to evaluate the total number of
rows generated by the rowsource and then update the ScrollBar's
properties.

In the Form's Load event do something like this:
Dim lngCount as long
lngCount = Me.YourComboName.ListCount

' End quote
 

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

Back
Top