Limit Of ListBox

M

Mike Painter

Roy Goldhammer said:
Hello there

When i bound listbox or combobox i can place as mutch data as i want

But when i load the listbox or combobox by my self i can't place more then
2048 characters

Does someone knows whay this limit and whay when i bound the listbox or
combobox to query it can place as mutch as data that i want?

I don't know why it is 2048 rather than 256 but in the one case you are
bound to a recordset which can be large and in the other you are limited to
what some programmer thought was a reasonable amount.
I can't think of anything that large which would not be better served by a
table.
 
A

Albert D. Kallal

It is kind of arbitrary limit.

The simple solution is to place your data into a table, and then let the
listbox feed on that table. When you use a query, there is not the same
limit.

Of course when you use a value list as a long string, then a string much
longer then 2000 characters is not the best thing to use anyway. All kinds
of performance problems would arise when you have to work with strings
larger that what is now allowed. It is probably a good idea that the
designers put that limit in, since allowing larger strings would be just
giving the users more rope to hang themselves with.

Further, any listbox with more then 20 or 30 entries is starting to be a bad
interface.

However, if you MUST create this data on the fly, then using temp table is
also a really bad idea. Using a temp table will bypass the limit of a
valuelist, but it will create un-necessary bloat in the application. Thus,
we really want to avoid the use of temp tables.

So, if you can, use a query, or even build the sql in code and just stuff it
into the listbox (this is best solution).

me.MyListBox.RowSource = "select * from table....etc."

If you must, or have to generate the data via code (and cannot come up with
some kind of query), then you can use what is called a call back function to
fill the listbox. The call back function works very well, has no 2000
characters limit, and you can even map the listbox right into a array you
declare. It is very useful when exhaust all other possible solutions.

Check out:
http://www.mvps.org/access/forms/frm0049.htm
 
P

PC Datasheet

<<Thus, we really want to avoid the use of temp tables.>>

A big AMEN to that, Albert!!!!!!

Steve
PC Datasheet
 
R

Roy Goldhammer

Hello there

When i bound listbox or combobox i can place as mutch data as i want

But when i load the listbox or combobox by my self i can't place more then
2048 characters

Does someone knows whay this limit and whay when i bound the listbox or
combobox to query it can place as mutch as data that i want?
 
M

Mike Painter

Roy Goldhammer said:
Well Albert

The reason i need a huge list box if for something that i developed for
setting user's menu options dinamicly

For short time ago i worked with one company only so i didn't need to set
multi workgroup application.

From now on i started to work with diffrent clients and on each client there
are some many levels of users.

Each user must get his own controls on the menu bar that he needs to use.
Since this is based on the user a simple query can be used to set the
recordsource for the listbox.
Even with only a few hundred options this will be noticably faster to the
end user than writing the code to build the record.
 
R

Roy Goldhammer

Well Albert

The reason i need a huge list box if for something that i developed for
setting user's menu options dinamicly

For short time ago i worked with one company only so i didn't need to set
multi workgroup application.

From now on i started to work with diffrent clients and on each client there
are some many levels of users.

Each user must get his own controls on the menu bar that he needs to use.

And i needed to belop multi user controls.

For this i need to load all the controls on my system and then limit them to
some user.

AS you can thing the name of controls which is 108 so far today and can
reach to 200 in the future explain where i have. Thankes for the program

I will learn how to use it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top