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