473,831 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Listbox max lenght valuelist

Dear All,

What is the max lenght of the valuelist-string as rowsource in a listbox ?
I use a listbox to show all the files in a folder.

Filip
Nov 13 '05 #1
2 3905
A test show 2048 as max stringlenght

"Filips Benoit" <be***********@ pandora.be> wrote in message
news:go******** *************** @phobos.telenet-ops.be...
Dear All,

What is the max lenght of the valuelist-string as rowsource in a listbox ?
I use a listbox to show all the files in a folder.

Filip

Nov 13 '05 #2
Look at using a user defined function instead.

Here's a sample from help in A97. If you paste the code below into the form
and then set the RowSourceType property of the listbox to ListMDBs it will
fill the list with a directory listing of mdb files. You can obviously
modify the code to fit your exact needs.
Function ListMDBs(fld As Control, id As Variant, row As Variant, col As
Variant, code As Variant) As Variant
Static dbs(127) As String, Entries As Integer
Dim ReturnVal As Variant
ReturnVal = Null
Select Case code
Case acLBInitialize ' Initialize.
Entries = 0
dbs(Entries) = Dir("*.mdb")
Do Until dbs(Entries) = "" Or Entries >= 127
Entries = Entries + 1
dbs(Entries) = Dir
Loop
ReturnVal = Entries
Case acLBOpen ' Open.
ReturnVal = Timer ' Generate unique ID for control.
Case acLBGetRowCount ' Get number of rows.
ReturnVal = Entries
Case acLBGetColumnCo unt ' Get number of columns.
ReturnVal = 1
Case acLBGetColumnWi dth ' Column width.
ReturnVal = -1 ' -1 forces use of default width.
Case acLBGetValue ' Get data.
ReturnVal = dbs(row)

Case acLBEnd ' End.
Erase dbs
End Select
ListMDBs = ReturnVal
End Function

--
Terry Kreft
MVP Microsoft Access
"Filips Benoit" <be***********@ pandora.be> wrote in message
news:i2******** *************** @phobos.telenet-ops.be...
A test show 2048 as max stringlenght

"Filips Benoit" <be***********@ pandora.be> wrote in message
news:go******** *************** @phobos.telenet-ops.be...
Dear All,

What is the max lenght of the valuelist-string as rowsource in a listbox ? I use a listbox to show all the files in a folder.

Filip


Nov 13 '05 #3

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

Similar topics

3
2499
by: Mike Top | last post by:
I want a listbox to position to a letter provided by the user. Normally, when the user keys a letter, the listbox positions automatically to the first entry starting with that letter in the first column. I want to allow the user to select the column to be searched. For eaxample, assume a list box that looks like this: ____________________________
4
2771
by: Alienz | last post by:
I have a subform where I have a subform with 20 options to select from. When I set the multiselect property to simple and select multiple options, nothing is stored. I have another table with fieldID and fieldtype and I would like for evertime something is selected in the listbox for a new entry to be created with that fieldtype for the corresponding fieldID which is linked to the main form. Basically, how do I get info from the listbox...
3
5049
by: mibispam | last post by:
Hallo, kann mir vielleicht jemand erklären, wieso ich neue Einträge in eine Listbox nicht per MeineListbox.additem hinzufügen kann?? Ich bekomme da immer wieder einen Laufzeitfehler. In Beispielen, die ich im Netz gefunden habe, benutzen alle diese Methode, aber bei mir funktioniert es ganz einfach nicht, oder liegt das vielleicht daraun, dass Ich Bibliotheken, die dafür benötigt werden nicht eingebunden habe? Vielleicht kann mir hier...
4
10364
by: Alan Lane | last post by:
Hello world: I have a ListBox that I fill as a ValueList from a SQL query. The SQL looks like: SELECT Format(COST,"$#,000") As ItemCost FROM tblPricing ... I put semicolons between each entry before I load it into the ListBox. However, if my entry has a comma in it ($2,500 for example) Access adds another column, thereby messing up the ListBox display. It shows as $2 and
4
4917
by: Peter Gibbs | last post by:
I need some help with this problem. I'm using Access 2002 with XP. My problem is with a 2-column listbox. My VBA code puts text data into the listbox. The problem is that the text data ocasionally includes commas (,) and full-stops (.) - and when the data is placed in a column, Access confuses the punctuation within the text with delimiters and splits the text across columns.
5
1744
by: Terry | last post by:
I would like to fill a listbox with a 2 column valuelist and hide the value in the first column as available in VBA. I have tried .items.add and item.addrange but cannot seem to get the desired result. I am using the form Load event to fill the listbox. Regards
2
2353
by: lgeastwood | last post by:
I have a Report with a listbox that I need to populate with a rowsource type = valuelist. The valuelist for each record is a saved SQL string complete with commas On my form I can set the valuelist in code. However on the report open or detail format events I cannot set the valuelist. Does anyone know of a way to put the SQL string into the rowsource property of the listbox on the report? Thanks
1
3307
by: m-sjoblom | last post by:
Hi On a form listbox Access version 2003 has a limited number or characters that can be stored in a listbox when the Row source Type is set to "Value List". Is there anybody that knows the limitation and is it possible to increase the "buffer" with a parameter.
5
1482
by: KUTTAN | last post by:
I have a ListBox I want to show it with 300px width.(increasing the with will lead to bad look of the page , in my case) But unfortunately the some data loaded to this ListBox is string having lenght more than 300px So user cant read it full , the right side are not seeing I can solve this by adding a horizontal scroll to the ListBox
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10777
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
10494
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
10534
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
6951
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
5620
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...
1
4417
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
2
3964
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
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.