How do you check to see if an object exists...for instance, cmdClick(1) in an array? Anyone got any idea?
Printable View
How do you check to see if an object exists...for instance, cmdClick(1) in an array? Anyone got any idea?
Depends what you mean? If you've got a control array, you could check cmdClick.UBound, or you could use a For Each loop and check which members of the array are present.
You might need to elaborate...
Let's say I had an array of 0-10 of an item and I unloaded 5...then I used a for/next to go through 0-10 doing something with them...how would I recognise that 5 isn't there any more?
I'm working on improving the tab code I uploaded earlier :-)
use a for each loop.
Doesn't help me...you know me, I'm useless :-)
How would I do the for each, it's not something I've done before
VB Code:
Dim ctl As Control For Each ctl In cmdClick Debug.Print ctl.Index Next ctl
Thanks, that seemed to work...now is going to come umpteen other problems :-)