Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling Arrays 1

Status
Not open for further replies.

LarryDeLaruelle

Technical User
May 19, 2000
1,055
US
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

 
Hey Larry,

Check this for accessing a specific row/col of a listbox:


Result = lst.Column(Col,Row)



where:

lst is list name
Column is propertyname
Col is column number
Row is Row number..


I hope this helps you,

John.
 
John:

You're the Man.

Worked like a charm.

Thank you very much.
Larry De Laruelle
larry1de@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top