Is there a way for VB to return an integer value for how many text boxes or labels are on a form?

I wish to use iteration to check for void inputs, and I am assuming I can use syntax within the loop similar to:_

IF txtBox[number]="" THEN
'Error message here'

Thanks