Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How may item listbox (in VBA) can hold ?

Status
Not open for further replies.

ooops

MIS
Dec 21, 2000
91
US
Hi,

Do listbox limit the ammount of item we can add ? What's the max number ? Thanks.


 
Yes, there's a limit, but it depends on what OS you're running. If I recall correctly, Win9x limits you to 32k of data, while WinNT/2K/XP limits you to 32k items.

But if you're running up against the limit, I would redesign how you're doing things. A user will not want to scroll through that much data -- you'd be better off implementing a "find" dialog.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
You will probably do better asking VBA questions in the VBA forum, forum707

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

For tsunami relief donations

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
The limit for the VB/VBA list boxes on WinNT/2K/XP is a legacy of the language rather than of the actual control. You can add a lot more than 32K items if you use the API) - mind you, no sensible design would ever really need you to do so...
 
no sensible design would ever really need you to do so...

That's exactly what I thought as I read through the posts...

32k is a LOT of items to choose from...

If you really have that many options to choose from, you might consider breaking them down into categories, or something...

I would hate to scroll through 32k of items in a listbox...

In short...
Yes, there is technically a limit, but it is high enough you typically don't have to worry about it... If you do max it out, you have bigger problems you need to address ;-)

Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top