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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checking in collections are empty 2

Status
Not open for further replies.

Luis939

MIS
Feb 28, 2003
453
US
I'm using a collection, however, if lets say the collection was declared but never assigned any other values, what would be the best way to detect that, I have

on error resume next
if mycollection(1) = Empty then msgbox "collection empty"

is this the best thing to do? so far this does work in my code, but i dont know if this is technically the correct way to do it, thanks!!
 
A little bit of over-kill there, Skip. All that's needed is:
[blue]
Code:
  If MyCollection.Count = 0 Then MsgBox "collection empty"
[/color]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top