Link to home
Start Free TrialLog in
Avatar of ddreese
ddreese

asked on

Listbox ListRows problem

I have a simple form with a listbox that lists the results of a search.  I'm very disapointed that for some reason it will only show a certain number of the results in the listbox, even when it scrolls.  

For instance, I may get 30 results from my search, and only 13 will show up in the list box.  

I have read somewhere that I should use the listrows property.  Where do I use this, and how do I set it?  I tried to put it in the event 'On Load' for the form that loads, but it doesn't work.  Can I specifically say list1.listrows = 255 or something like that???  I'm confused.
ASKER CERTIFIED SOLUTION
Avatar of AccQ
AccQ

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddreese
ddreese

ASKER

Yea I thought that was interesting too.  I had tried to type in that code, but it didn't seem to work for me.  I did a search on google though and found the following code that seems to have fixed it:

Dim ListControl As Control

Set ListControl = List2

ListRows = List2.ListCount

I'm not sure why that works when I hardcoding it didn't seem to work:

List2.ListRows = 255

Thank you for your quick response though!
Glad your problem is solved. If you would like to ask for a refund for this question, just post your request for refund in the Community Support ("CS") section. Thanks.
Avatar of ddreese

ASKER

That won't be necessary, I have plenty of points to go around :)  Thanks again for your help.
It is pleasant to get points for learning something. Kind of like being in school, without the torture of final exams. Thank you.