473,413 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Can ListBox be pre-loaded for better scrolling?

I have an Access 2003 mdb with a Main Form that has a ListBox with a long
list of items. The problem is the scroll bar on the ListBox does not scroll
all the way to the end unless you first scroll half way, then let up the
left mouse button, and then continue to scroll to the end of the list. But
once you've scrolled the entire list once, the scroll bar works fine.

The Main Form gets requeried at times due to different events which puts the
ListBox scroll bar behavior back in the half-way mode again. Is there a way
to pre-load the ListBox so I can avoid this annoying scroll bar behavior?

Thanks in advance.
Nov 13 '05 #1
4 3199
deko wrote:
I have an Access 2003 mdb with a Main Form that has a ListBox with a
long list of items. The problem is the scroll bar on the ListBox
does not scroll all the way to the end unless you first scroll half
way, then let up the left mouse button, and then continue to scroll
to the end of the list. But once you've scrolled the entire list
once, the scroll bar works fine.

The Main Form gets requeried at times due to different events which
puts the ListBox scroll bar behavior back in the half-way mode again.
Is there a way to pre-load the ListBox so I can avoid this annoying
scroll bar behavior?

Thanks in advance.


I think if you add a line of code that retrieves the ListCount that it forces
the ListBox to retrieve all of its rows. This will of course introduce a delay
while that is occurring. You might simply be replacing one problem with
another.

It is usually considered a *good* thing that Access ComboBoxes and ListBoxes do
not retrieve all of their rows when first displayed. Why retrieve data that
might not be needed? For someone reviewing existing entries they might not even
use the items in the list at all and yet they will still pay the performance
penalty for having all of that data retrieved.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
> I think if you add a line of code that retrieves the ListCount that it
forces
the ListBox to retrieve all of its rows. This will of course introduce a delay while that is occurring. You might simply be replacing one problem with
another.


Thanks for the reply. Can you give me an example of how I would do this? I
understand there may be latency cost in doing this, but it's a price I'm
willing to pay.
Nov 13 '05 #3
deko wrote:
I think if you add a line of code that retrieves the ListCount that
it forces the ListBox to retrieve all of its rows. This will of
course introduce a delay while that is occurring. You might simply
be replacing one problem with another.


Thanks for the reply. Can you give me an example of how I would do
this? I understand there may be latency cost in doing this, but it's
a price I'm willing to pay.


Just set a variable to the ListCount property.

Dim MyVariable as Long

MyVariable = Me.ListBox.ListCount

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4
> Just set a variable to the ListCount property.

Dim MyVariable as Long

MyVariable = Me.ListBox.ListCount


That works great!! Thanks!! The convenience of being able to immediately
scroll all records is well worth whatever latency I'm paying. Thanks
again - this is a very nice improvement!
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Coz | last post by:
Hi all, I'm looking for help again!!! I have been writing a page to update a database but now have another 'silly' problem with listbox's...Grrr... I'm trying to populate the list box with...
3
by: Andrew | last post by:
I'm having a major problem with a databound listbox in C#. In the constructor for the form I am trying to pre-select some of the items based in information in the database. When I step through the...
7
by: 00_ChInkPoIntD12 | last post by:
Can anyone confirm there isn't a Sort() method for WebControl Listbox in Asp.net? It is rather simple to write a method to do the sorting, but just wondering I shouldn't invent the wheel if...
9
by: Fred Morrison | last post by:
I need to bind a true date value to a listbox control via a DataSet that contains true date values (not strings). The problem is, the list contains the time (always midnight in my case). Other...
2
by: ljlevend | last post by:
I want to be able to arrange the order of items within a ListBox using drag-and-drop and also drop an item at a specific location of a different ListBox. The following Microsoft Knowledge Base...
1
by: David J | last post by:
Hi, I am trying again, and seriously struggling. My problem is that I am trying to set the selected value in a listbox equal to a value of a textbox, when you op the listbox. I am not getting that...
11
by: John Dann | last post by:
I'm still struggling to find a way of reordering the items within the same single listbox with drag and drop. I think I've got the drag working but it's the drop code I can't figure out. What I...
3
by: ML | last post by:
I have used Allen Brown's technique for filling a listbox on a form with the names of files in a certain disc folder. It works well. I am now giving the user the option to print the form...
2
by: dan NY | last post by:
I'm a struggling new VB Applications user that has what may be a simple question, but I've been struggling with it. I'm using a response to a message box YesNo question to cause one of two...
15
by: Doogie | last post by:
I have a .net app that a user currently enters a number in a text box, hits a button and a data call is executed. She wants the ability to enter in multiple numbers (up to 100). So to make...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.