Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

Listbox Vertical Scroll Bar Behaviour

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rikard Blomberg - 18 Mar 2005 14:43 GMT
I am using a multi-select listbox to show the results from a query in my
application. This is done like:

listbox.RowSource = strSQL
listbox.Requery

when I get a result-set that has more rows than ehat fits my listbox I get a
vertical scroll-bar. The problem occurs when the user clicks on or drags the
scroll-bar. The scroll bar doesn't seem to know how many entries there are in
the list resulting in a "jumping" behaviur, for example if the user drags the
"elevator icon" of the scroll bar to the bottom it will typically jump up to
the middle of the bar. Repeating the dragging action will slowly get the
"elevator" icon lower. Once the user reached the bottom of the scroll-bar the
problems are gone and the scroll bar seems to be working perfectly. Calling
requery again makes the problem return.

Anyone knows how to get around this problem?

Thanks
/Rikard
Stephen Lebans - 18 Mar 2005 15:08 GMT
First of all you do not need to call the control's Requery method as
setting the RowSource property will naturally force a requery.

As to your second issue here is a previous post on mine on this subject.
It applies equally to List and Combo controls.

A quick search on GoogleGroups can be a valuable timesaver.
From: Stephen Lebans (NoEm...@please.com)
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.

> I am using a multi-select listbox to show the results from a query in my
> application. This is done like:
[quoted text clipped - 16 lines]
> Thanks
> /Rikard
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.