473,725 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jun 27 '08 #1
1 5829
On Apr 16, 8:04 am, Chaihana Joe <i...@chezburns .comwrote:
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
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4940
by: James Goodman | last post by:
I have a listbox named sub1 on an asp page. I need to fill this list with values from a table. These are selected based upon the selection of a value/s in another listbox. It was suggested that I use a hidden iframe on my main page, & carry out the processing inside the frame, using jscript. If I open the page in a browser, & make a selection in the first listbox (named main), the data in the frame appears to be processed correctly, the...
2
4513
by: James A | last post by:
I have 3 problems which I'd like people to solve for me (I've run out of ideas) 1) I have a table called s7-300. If i simply run this line of code: lstResult.rowsource = "Select * FROM S7-300"
5
17134
by: Mark | last post by:
How can I populate a listbox with a list of the filenames in a certain folder? Can a query retrieve the filenames from a folder? Thanks! Mark
0
1181
by: James | last post by:
Hello, This is a bit complicated but the bottom line is this: I have a form, class, and 'wrapper' function in an MDE that I have listed in my References. (The 'wrapper' is to enable referring to the class from another database that References the MDE.) The form has a listbox object whose Rowsource I set to an SQL string that I pass as a parameter to the wrapper. Here is my problem: once displayed, the list box appears empty (as though...
1
5177
by: Grant Hammond | last post by:
I have a callback function that populates a listbox with a list of file names in a folder. This code came from Terry Kreft/Dev Ashish some years ago. I now want to add another column to the list box to display the date of the file. I have started modifing the code to handle a 2 coulmn array, but it dosnt look like I can just change the variable to an array. Here is the code with my hichlights where I started changing it to an
4
4677
by: Corey | last post by:
I am having some real trouble getting a listbox rowsource to load properly. The listbox is actually on a subform. My main form has several command buttons that change the MASTER_SUB_FORM object source to the specific sub form needed by the end user. When designing the sub form i used the querybuilder to create an SQL statment to define the listbox values. **** RowSource SQL Statement ****
3
8103
by: Prochot | last post by:
I'm trying to design a database to track projects and the associates assigned to them. I have almost no experience with this. I have three tables: -Projects -Associates -Assignments where assignments contains projectID and associateID and is related to the projects.projectID primary key and the associates.associateID primary key. I have a form based on the projects table that contains a list box that I would like to use to...
6
4379
by: cwhitcomb2 | last post by:
I have created a form in my database that resembles a calendar. I have 42 textboxes that display the day of the week for whatever month and year is selected in the combo boxes at the top of the form. The text boxes are named Text1, Text2, etc. The combo boxes are named cboYear and cboMonth. Here is the problem: I put a listbox under each textbox that should show the project# for the projects that are active on that day. I'm using 3 fields...
4
2344
by: George Allen | last post by:
I have been experimenting wiht using the Listbox Callback function to solve an issue I have with my db tool. The function below connects ADO to a SQL server database and table and reads those members of the table that fit the criteria and then fills in two columns in my listbox. So far, it appears to init well, filling the array properly. What I am having a problem with is the control calls with the code acLBGetColumnWidth (5) three times. ...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.