Solved

Listbox ListRows problem

Posted on 2003-10-30
5
261 Views
Last Modified: 2010-08-05
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.
0
Comment
Question by:ddreese
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
AccQ earned 125 total points
ID: 9650543
Interesting that when typing in the code, ListRows does not display when I type "myList.", yet the code does seem to work. I'm not an expert, but here's what I did. I used the following code:

Form_Load
myList.ListRows = 200
End Sub

My table only has 44 records, but all 44 showed up in the list box. Try it and see if it works. (I have Access 2000).
0
 

Author Comment

by:ddreese
ID: 9650617
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!
0
 
LVL 1

Expert Comment

by:AccQ
ID: 9650836
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.
0
 

Author Comment

by:ddreese
ID: 9651126
That won't be necessary, I have plenty of points to go around :)  Thanks again for your help.
0
 
LVL 1

Expert Comment

by:AccQ
ID: 9651154
It is pleasant to get points for learning something. Kind of like being in school, without the torture of final exams. Thank you.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question