Again: No error checkin needed
You just use the same technique again:
Code:
if not mcol(vntindexkey) is nothing then
set item=mcol(vntindexkey)
end if
the item will remain nothing if theres no reference
Error when not error checking
Dear Kedaman,
using following code (as suggested):
Code:
Public Property Get Item(vntIndexKey As Variant) As Gas
'used when referencing an element in the collection
'vntIndexKey contains either the Index or Key to the collection,
'this is why it is declared as a Variant
'Syntax: Set foo = x.Item(xyz) or Set foo = x.Item(5)
If Not mCol(vntIndexKey) Is Nothing Then
Set Item = mCol(vntIndexKey)
End If
End Property
does generate following error
run-time error 5 : invalid procedure call or argument
at the line
Code:
If Not mCol(vntIndexKey) Is Nothing Then
because You cant use mcol(vntIndexKey) when vntIndexKey does not exist in the collection !!!!
So I think, I have to check for an error right here....
Unless someone else disagrees with me and supplies a solution for this
IT MIGHT BE YOU.....POST IT (please ?)
greetinx,
Don