ListBox.AddItem error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

when I fill up my ListBox (value list) with

ctrlListBox.AddItem Item:=strItem

the 193rd item genrates a runtime error 2176.

I would be surpised if only 192 items were allowed.

Is that a bug or a feature ?
 
Hi Henry,

As far as I can remember there is a limit on the number of items in a
listbox, but it's certainly much greater than 192. More likely you're
hitting a limit on the length of the ValueList string. If so, you'll need
either to use shorter or fewer items, or else put them in a table and use a
query for the listbox's RowSource.
 
I don't know what version of Access you are talking about. My information
comes from Access 2002 Desktop Developer's Handbook by Paul Litwin, Ken Getz,
and Mike GunderloyChapter 7 page 336:
"Enter a list of values, separated by semicolons, one row at a time (up to
2,048 characters)."
 
You're wrong Benjamin. Access List and Combo controls are not the same as
their VB counterparts.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top