By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,705 Members | 1,852 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,705 IT Pros & Developers. It's quick & easy.

Listbox max lenght valuelist

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 acLBGetColumnCount ' Get number of columns.
ReturnVal = 1
Case acLBGetColumnWidth ' 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 discussion thread is closed

Replies have been disabled for this discussion.