You have to loop through... in that event.. for every object in your arraylist... and I dont see where you have the object name as part of the object???
*also, all of the CStr shouldnt be necessary. If they are already a string, no need to cast them into a string. For the ones you need to cast, you can use just .ToString()VB Code:
'in your changed event, just hand-coded using guesses of your code... For Each Obj as MyObject in MyObjects If Cstr(Obj.CompanyName) = cboCompanyName.Text then '<-- MyObject.CompanyName is the company text of your object, didnt see that in the code above? txtPDate.Text = CStr(Obj.PurchaseDate()) txtShares.Text = CStr(Obj.Shares) txtPPrice.Text = CStr(FormatCurrency(Obj.PurchasePrice())) txtTValue.Text = FormatCurrency(Obj.TotalValue()) txtWorth.Text = CStr(FormatPercent(Obj.TotalValue() / Obj.TotalValue())) Exit For End If Next




Reply With Quote