Results 1 to 6 of 6

Thread: check numerous text boxes to see if empty...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2001
    Posts
    297

    check numerous text boxes to see if empty...

    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

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    This might sound rude... but, search the fourms, please
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    McBain's right!

    Too much people ask a question before searching ?

    Almost every question is already anwsered on this forum!

    "Use the search"

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2001
    Posts
    297
    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

  5. #5
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

  6. #6
    Megatron
    Guest
    There are 2 methods.

    1) Using a control array
    VB Code:
    1. For i = 0 To UBound(Text1)
    2.         If Len(Text1(i).Text) > 0 Then
    3.             MsgBox "A textbox is not empty"
    4.             Exit For
    5.         End If
    6.     Next i

    2) Without a control array (inefficient, but still works)
    VB Code:
    1. For i = 1 To 10
    2.         If Len(Me("Text" & i).Text) > 0 Then
    3.             MsgBox "A textbox is not empty"
    4.             Exit For
    5.         End If
    6.     Next i

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width