O
onedunpark
Hello,
I'm sure someone will be able to pull me out of the mud on this one.
Having defined an ADO Recordset, I'm populating a listbox with multiple
values from the single column pointed to by the Recordset. The user
chooses the relevant value from the list displayed and then I use the
selected value to identify other related information for the
selection.
I'm typically using this to diplay a list of names and then extract
additional info. based on the name chosen
I'd like, however, to bring back other values from the Recordset, load
only the descriptive field into the listbox, and based on the user
selection extract the other values from the Recordset, rather than
having to perform a number of lookups from the database again based on
the selection.
I'm sure I must be able to
1. load the name, index, etc from the recordset (into a
multi-dimensional array?)
2. display only the first column in the array (the name field) into
the list box
3. once the uer has selected the relevant name from the listbox
4. extract the index from the array based on the name selected in the
listbox by the user.
Anyway, the code to create the basic array is as follows:
vcount = 1
With vrset
Do While Not .EOF
ReDim Preserve CmpArray(vcount)
CmpArray(vcount) = !COMPNAME
vcount = vcount + 1
..MoveNext
Loop
End With
Any tips on how to:
1. define/populate the array
2. display only a specific column of the array in the listbox
3. extract other elements of the same row from the array based on the
selection
would be massively appreciated.
Thanks in advance,
Steven Hoggan
I'm sure someone will be able to pull me out of the mud on this one.
Having defined an ADO Recordset, I'm populating a listbox with multiple
values from the single column pointed to by the Recordset. The user
chooses the relevant value from the list displayed and then I use the
selected value to identify other related information for the
selection.
I'm typically using this to diplay a list of names and then extract
additional info. based on the name chosen
I'd like, however, to bring back other values from the Recordset, load
only the descriptive field into the listbox, and based on the user
selection extract the other values from the Recordset, rather than
having to perform a number of lookups from the database again based on
the selection.
I'm sure I must be able to
1. load the name, index, etc from the recordset (into a
multi-dimensional array?)
2. display only the first column in the array (the name field) into
the list box
3. once the uer has selected the relevant name from the listbox
4. extract the index from the array based on the name selected in the
listbox by the user.
Anyway, the code to create the basic array is as follows:
vcount = 1
With vrset
Do While Not .EOF
ReDim Preserve CmpArray(vcount)
CmpArray(vcount) = !COMPNAME
vcount = vcount + 1
..MoveNext
Loop
End With
Any tips on how to:
1. define/populate the array
2. display only a specific column of the array in the listbox
3. extract other elements of the same row from the array based on the
selection
would be massively appreciated.
Thanks in advance,
Steven Hoggan