Change A Value In a HashTable?

S

Slonocode

I have a collection of objects in a hashtable.

The objects have a datamember that is empty.

I need to loop through the items in the hashtable and add data to the
datamember that is empty.

htShippingItems is the hashtable which contains a collection of
ShippingItems. Each shipping item has a datamember called Itemized that I
need to populate with a string.
-----------------------------------------------------------------
Sub MergeMultiples

Dim m As clsMultiple
Dim s As clsShippingItem
Dim str As String
For Each s In htShippingItems.Values
If s.Multi = "-1" Then
For Each m In htMultiples.Values
If m.Multi = s.ItemID Then
str &= m.ItemID & "," & m.Description & ","
End If
Next
str = str.TrimEnd(",")
s.Itemized = str

End If
str = ""
Next

End Sub
--------------------------------------------------------------------

Im obtaining the data I need from another hashtable which contains a
collection of Multiple Objects.

At the point of str = str.TrimEnd(",") the str variable contains the desired
data and it gets assigned to s.Itemized.

But Afterwards if I try to access the Itemized member from the hashtable it
is null.


Thanks for any help
Slonocode
 
S

Slonocode

Oops nevermind the code I posted actually works I had a logic error
elsewhere that was preventing me from seeing the data I wanted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top