LarryDeLaruelle
Technical User
Is it possible to reference a list box column when extracting the selected items to fill arrays?
I have a list box that feeds a report/letter with two items -- Item Changed and Reason for Change.
I have dimensioned two one column arrays to hold the values the user selects from the list box and I can get the first value in without a problem. (I started this way because of the problem below -- hopefully, if I can solve this, I'll use a two dimensional array.)
What I can't figure out is how to specify Column(1) to get the second value. This is the code I'm using right now:
For intLoop = 0 To intCount - 1
If lstDrugs.Selected(intLoop) = True Then
intArrCnt = intArrCnt + 1
ReDim Preserve strDrugType(intArrCnt)
strDrugType(intArrCnt) = lstDrugs.ItemData(intLoop)
End If
Next intLoop
To fill strDrugChange, I need to reference the second column in the list box and that's what is driving me crazy.
I tried lstDrugs!ItemData(intLoop).Column(1) and various other formats and get nasty messages.
I'll be eternally grateful to anyone who can help me with this.
Thanks.
Larry De Laruelle
larry1de@yahoo.com
I have a list box that feeds a report/letter with two items -- Item Changed and Reason for Change.
I have dimensioned two one column arrays to hold the values the user selects from the list box and I can get the first value in without a problem. (I started this way because of the problem below -- hopefully, if I can solve this, I'll use a two dimensional array.)
What I can't figure out is how to specify Column(1) to get the second value. This is the code I'm using right now:
For intLoop = 0 To intCount - 1
If lstDrugs.Selected(intLoop) = True Then
intArrCnt = intArrCnt + 1
ReDim Preserve strDrugType(intArrCnt)
strDrugType(intArrCnt) = lstDrugs.ItemData(intLoop)
End If
Next intLoop
To fill strDrugChange, I need to reference the second column in the list box and that's what is driving me crazy.
I tried lstDrugs!ItemData(intLoop).Column(1) and various other formats and get nasty messages.
I'll be eternally grateful to anyone who can help me with this.
Thanks.
Larry De Laruelle
larry1de@yahoo.com