Query doesn't finish before ListBox displays it.

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?
 
J

Jeff Conrad

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
 
Top