Access form ListBox Vertical ScrollBar

I have a listbox on a form which has over a 1000 names listed on it.
When I drag the vertical scrollbar down I would like to see the data move with it.

Can an expert suggest how to do this please.
LVL 1
PeterWhittsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
that is weird.. i got a listbox with more than that and the list shows as  you drag the v scrollbar..

can you try creating a new form, place a listbox and use the same rowsource. see if it will behave the same
0
PeterWhittsAuthor Commented:
Same result.  I am using the following....by the way ...the record count  should have read 10,000 not 1000 and the list is showing unique records

SELECT DISTINCT tblCustomers.Company FROM tblCustomers WHERE (((tblCustomers.Company) Is Not Null)) ORDER BY tblCustomers.Company;


Using PageDown gets a move on but the scroll bar has very little affect....does it have a scale I can change
0
Rey Obrero (Capricorn1)Commented:
the only scale i could think of is the Grid X and Grid Y property of the form...

here is work around to limit the amount of records to display

http://allenbrowne.com/ser-32.html

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Rey Obrero (Capricorn1)Commented:
oops sorry, that is for a combo box not a listbox..
0
Rey Obrero (Capricorn1)Commented:
do you want a listbox that narrows the selection when you type characters in an unbound Textbox?, like the one in address book of outlook.
0
PeterWhittsAuthor Commented:
that would be useful...yes please
0
Rey Obrero (Capricorn1)Commented:
create an unbound Textbox, txtCompanySearch

place this codes in the change event of the textbox

private sub txtCompanySearch_change()
dim db as dao.database, rs as dao.recordset, sql as string
sql="select distinct Company FROM tblCustomers where company like '" & me.txtCompanysearch.text & "*'"

set rs=db.openrecordset(sql,dbopensnapshot)
if rs.recordcount>0 then
  rs.movefirst
  me.listboxName=rs!company   '< change listboxname to actual name
end if
rs.close
db.close
end sub
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PeterWhittsAuthor Commented:
Thanks for that.

I get a rte 91 "Object variable with Block variable not set"  against

Set rs = db.OpenRecordset(sql, dbOpenSnapshot)

:~(
0
Rey Obrero (Capricorn1)Commented:
oops

set db=currentdb
Set rs = db.OpenRecordset(sql, dbOpenSnapshot)
0
PeterWhittsAuthor Commented:
unfortunately the list isnt changing although the code seems to work carrying the variable through ok on a break point and F8
0
Rey Obrero (Capricorn1)Commented:
can you upload a copy of your db?
0
PeterWhittsAuthor Commented:
unable as too much confidential stuff
0
PeterWhittsAuthor Commented:
can you present a small working example?
0
Rey Obrero (Capricorn1)Commented:
0
PeterWhittsAuthor Commented:
Fine now....took a screen dump of your settings and compared them to mine...must have changed some in trying to get it to work...but now ok.

If it is not too much bother, is there a way of getting the focused record in the middle of the listbox as it is always at the bottom.

Many thanks for your help so far.
0
PeterWhittsAuthor Commented:
I will add the extra question as a new question..many thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.