Ok, check this out, I put some references to class objects in a collection and use an integer that is converted to a string as the key
MDIParent.AddLoanToCollection clsNewLoan, CStr(intThisForm)
Public Sub AddLoanToCollection(ByRef aLoan As clsLoan, ByVal intFormKey As String)
colLoans.Add aLoan, intFormKey
End Sub
now, how do i extract the key from the collection to use it in a string...
reason:
when i put the class in the collection i send it a number that basically describes which loan it is, such as loan 1 or 2 or 3.
Later, I will use a For...Each loop to go through the collection, but I need the number that was used as a key.
the reason is that a user might delete one or more of the loans from the collection and I don't want it renumbering them. I wan the number that was used as a key to stay that way. So, a count on the for...each loop won't satisfy.
Any ideas? I just don't know what the correct syntax is to get the key back.
thanks. steve.
MDIParent.AddLoanToCollection clsNewLoan, CStr(intThisForm)
Public Sub AddLoanToCollection(ByRef aLoan As clsLoan, ByVal intFormKey As String)
colLoans.Add aLoan, intFormKey
End Sub
now, how do i extract the key from the collection to use it in a string...
reason:
when i put the class in the collection i send it a number that basically describes which loan it is, such as loan 1 or 2 or 3.
Later, I will use a For...Each loop to go through the collection, but I need the number that was used as a key.
the reason is that a user might delete one or more of the loans from the collection and I don't want it renumbering them. I wan the number that was used as a key to stay that way. So, a count on the for...each loop won't satisfy.
Any ideas? I just don't know what the correct syntax is to get the key back.
thanks. steve.