Populate listbox rowsource from function

Populate listbox rowsource from function

am 16.04.2008 15:04:50 von Chaihana Joe

Hi

I'm trying to populate a listbox as a value list in code (access
2003).

Unfortunately I'm getting 'runtime error 2176 - the setting for this
property is too long' somewhere around the 2000 character mark.

Searching on the web I've seen mention that there is a limit of 2048
characters for a value list and that a workaround is to use a function
to populate the list. But I can't see anywhere how to actually do
this.

Does anyone have a reference or an example of how it works?

(I can populate the list fine using a query, but would prefer not to
have the control bound to the data.)

TIA

Re: Populate listbox rowsource from function

am 16.04.2008 22:31:25 von deluxeinformation

On Apr 16, 8:04 am, Chaihana Joe wrote:
> Hi
>
> I'm trying to populate a listbox as a value list in code (access
> 2003).
>
> Unfortunately I'm getting 'runtime error 2176 - the setting for this
> property is too long' somewhere around the 2000 character mark.
>
> Searching on the web I've seen mention that there is a limit of 2048
> characters for a value list and that a workaround is to use a function
> to populate the list. But I can't see anywhere how to actually do
> this.
>
> Does anyone have a reference or an example of how it works?
>
> (I can populate the list fine using a query, but would prefer not to
> have the control bound to the data.)
>
> TIA

There is a good example of this (using a callback function to fill a
listbox) by Dev Ashish at the Access web:

http://www.mvps.org/access/forms/frm0049.htm

HTH,
Bruce