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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"The setting for this property is too long" Listbox

Status
Not open for further replies.

Mtlca401

Programmer
Mar 18, 2003
42
0
0
US
access is telling me that the rowsource of a listbox only accepts 2048 char max. Now I know this can't be true because I put a column from a table with more than 2048 char in the listbox, and it worked fine. I am setting this through a string. I can set the same string to a text box, but not the listbox.(I am using the listbox as a value list.)

Is there a way around this other than adding each value to a table and setting it through the list box that way?
 
Actually it is true. But you must remember that there is a difference between what the listbox can hold in its ItemData array, and the maximum length of the RowSource property.

The ListBox can handle more than 2048 characters, but the length of the RowSource property is limited to 2048 characters.

Basically, you have two methods to deal with this. Place all of your desired ListBox values in a table, and set the RowSource to an SQL statement to load the ListBox. By the way, the maximum length of the SQL statement will be the same 2048 characters because the RowSource is limited to 2K characters. That might help clear up the misunderstanding between the ListBox capacity, and the maximum length of the RowSource property.

The second method is to use a Callback function to load the listbox. There have been several threads outlining this technique and a quick search should locate one of them.


Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Oh....I thought they would be the same thing.

I'll try and see what I can do.

thanks
 
I looked at the callback function and don't understand what to do with it.

I want to try the callback just to see what it actually does.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top