G
Giangi
Hello everybody, I need yuor help because I would populate, via VBA, a
listbox with more than one field, but I don't be able to realized this.
I have written this code that is good for only one field:
Function RiempiElenco_Iper(ctlControlloCorr As Control, vntID, vntRiga,
vntCol, vntCodice)
'
Static Matrice() As String, intElem As Integer
Dim vntValRit As Variant, Path As String
vntValRit = Null
Path = Forms![Gestione Ipertesti]![Path_IN] & "\*.*"
If Path = "\*.*" Then Exit Function ' apertura del
form
Select Case vntCodice
Case acLBInitialize
intElem = 0
ReDim Matrice(0)
Matrice(intElem) = Dir(Path)
Do Until Matrice(intElem) = ""
intElem = intElem + 1
ReDim Preserve Matrice(intElem)
Matrice(intElem) = Dir
Loop
vntValRit = intElem
Case acLBOpen
vntValRit = Timer
Case acLBGetRowCount
vntValRit = intElem
Case acLBGetColumnCount
vntValRit = -1 ' N°colonne definite nella casella di riepilogo
Case acLBGetColumnWidth
vntValRit = -1 ' usa la larghezza definita nella casella di
riepilogo
Case acLBGetValue
vntValRit = Matrice(vntRiga)
Case acLBEnd
Erase Matrice
End Select
RiempiElenco_Iper = vntValRit
End Function
Someone would suggest me the way to implement others fields in the same list
box?
Many thanks in advance
listbox with more than one field, but I don't be able to realized this.
I have written this code that is good for only one field:
Function RiempiElenco_Iper(ctlControlloCorr As Control, vntID, vntRiga,
vntCol, vntCodice)
'
Static Matrice() As String, intElem As Integer
Dim vntValRit As Variant, Path As String
vntValRit = Null
Path = Forms![Gestione Ipertesti]![Path_IN] & "\*.*"
If Path = "\*.*" Then Exit Function ' apertura del
form
Select Case vntCodice
Case acLBInitialize
intElem = 0
ReDim Matrice(0)
Matrice(intElem) = Dir(Path)
Do Until Matrice(intElem) = ""
intElem = intElem + 1
ReDim Preserve Matrice(intElem)
Matrice(intElem) = Dir
Loop
vntValRit = intElem
Case acLBOpen
vntValRit = Timer
Case acLBGetRowCount
vntValRit = intElem
Case acLBGetColumnCount
vntValRit = -1 ' N°colonne definite nella casella di riepilogo
Case acLBGetColumnWidth
vntValRit = -1 ' usa la larghezza definita nella casella di
riepilogo
Case acLBGetValue
vntValRit = Matrice(vntRiga)
Case acLBEnd
Erase Matrice
End Select
RiempiElenco_Iper = vntValRit
End Function
Someone would suggest me the way to implement others fields in the same list
box?
Many thanks in advance