List Box ? Scroll

  • Thread starter Thread starter Steve Warren
  • Start date Start date
S

Steve Warren

I have a table with 4000 customers (tblCustomers)

I have a form (frmCustomerList), which is a single form with a list box of
customers(lstCustomers)

The list box is say 4" in height with 4,000 customers, when I scroll down
the list, I have to keep pulling the scroll bar to the end about 20 times to
get to the end of the list. My Question.........What code can I use to
eliminate the problem.

Thank you
Steve
 
Steve,
That's probably because, due to the large number of records listed, while
you can see the first 20 or so selecections, the listbox... further on down
the line is still populating. The way it seems to work is that the combo
only initially updates the 20 or so records viewable in the listbox. If you
scroll down, Access goes back and finds each record as you demand ( A's,
then B's then C's etc.)

Rather than "scroll" to your selection, try typing the first character
(or two) of the choice you want in the listbox (with AutoExpand set to
Yes)... say "S" for Smith, and then try the drop down. All the S results
should display quickly. Using this method, you don't "load" up the combo
with A, B, C, etc... records... just to get to S.
 
Thank you
Mental block

Al Camp said:
Steve,
That's probably because, due to the large number of records listed,
while you can see the first 20 or so selecections, the listbox... further
on down the line is still populating. The way it seems to work is that
the combo only initially updates the 20 or so records viewable in the
listbox. If you scroll down, Access goes back and finds each record as
you demand ( A's, then B's then C's etc.)

Rather than "scroll" to your selection, try typing the first character
(or two) of the choice you want in the listbox (with AutoExpand set to
Yes)... say "S" for Smith, and then try the drop down. All the S results
should display quickly. Using this method, you don't "load" up the combo
with A, B, C, etc... records... just to get to S.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
Al Camp:

You started out talking about list boxes but switched to combos half
way through. I didn't know you could type a value into a list box.
 
A quick search on GoogleGroups can be a valuable timesaver.
From: Stephen Lebans ([email protected])
Subject: Re: Combo scrolling
View this article only
Newsgroups: microsoft.public.access.formsc­oding
Date: 2001-12-19 10:08:48 PST


As John mentioned, 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



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Yes, I did go off on combos by mistake, but the idea of entering 1
character to get to an area of the list still works, and Steve got it
despite my rambling...

While the Listbox has the focus, hitting any character key will work just
like Auto Expand for a combo. "S" = jump to the first S in the list.

I very rarely use listboxes, as they take up too much real estate on the
form area. If I have room, and it's a high volume entry form, I will... but
primarily I use combos.
 
Back
Top