++ List Box - Data Too Long?? ++

  • Thread starter Thread starter Wembly
  • Start date Start date
W

Wembly

Hi,

I have a List Box on the form that uses values list
populated by code.

I have been getting this error message and was wondering
if the sheer size of the list has anything to do with it.
Here's the runtime error: "Run-time error '2176' The
setting for this property is too long."

I checked the dsata contained in the variable which holds
the values prior to assigning it to the list box's row
source property, and it is very long. Could this be
causing this problem?

Thanks,
Wembly
 
Wembly,
Yes. If you are using a Value list, there is some
character limit to it. I encountered it once and it was
something like 1024 characters.
You are much better off setting your Row Source Type
to Table/Query and linking to a table with SQL to get
your Row Source.
Terry
 
Wembly,

if you really need to populate your listbox by code, you can use a user
defined function on the RowSourceType property of this listbox.
Just look in Access' help for this, there is a good example of how to do it.
Instead of selecting values list, you just type your function in the
RowSourceType property of the listbox.

hth
Günter
 
Back
Top