Populate listbox rowsource from function

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
Chaihana Joe [ Mi, 16 April 2008 15:04 ] [ ID #1943715 ]

Re: Populate listbox rowsource from function

On Apr 16, 8:04 am, Chaihana Joe <i... [at] chezburns.com> 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
deluxeinformation [ Mi, 16 April 2008 22:31 ] [ ID #1943730 ]
Datenbanken » comp.databases.ms-access » Populate listbox rowsource from function

Vorheriges Thema: Access 1997 or 2003 or 2007?
Nächstes Thema: Date range of MS Access query