Say I have 10 textboxes on a form, how can check to see if any of them are empty? If text1 through text10 = "" Then blah
Printable View
Say I have 10 textboxes on a form, how can check to see if any of them are empty? If text1 through text10 = "" Then blah
This might sound rude... but, search the fourms, please
McBain's right!
Too much people ask a question before searching ?
Almost every question is already anwsered on this forum!
"Use the search"
thanks for being so helpful..i have already tried to search, i always do before i post. You try searching and see if u come up with anything
Are you sure you tried??
http://www.vbforums.com/search.php?s...der=descending
There are 2 methods.
1) Using a control array
VB Code:
For i = 0 To UBound(Text1) If Len(Text1(i).Text) > 0 Then MsgBox "A textbox is not empty" Exit For End If Next i
2) Without a control array (inefficient, but still works)
VB Code:
For i = 1 To 10 If Len(Me("Text" & i).Text) > 0 Then MsgBox "A textbox is not empty" Exit For End If Next i