Results 1 to 9 of 9

Thread: [RESOLVED] checkboxes

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Resolved [RESOLVED] checkboxes

    Hi,
    I used an array of checkboxes.as in the example below
    VB Code:
    1. for i=0 to 10
    2. check1(i).value=1
    3. next
    and I want to get a message to know that all checkboxes are checked
    There is no check.count so how do you do it ?
    **My same question is true for textboxes..I want to get a message when all textboxes in the array are filled with a text..

    thanks..

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: checkboxes

    VB Code:
    1. Dim i As Long
    2.    For i = 0 To 10
    3.      If Check(i).Value <> vbChecked Then
    4.         MsgBox Check1(i) & (i) & " is not checked"
    5.      End If
    6. Next

  3. #3

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Re: [RESOLVED] checkboxes

    Thanks..Hack
    What about textboxes ? if any of the textboxes in the array are empty..
    VB Code:
    1. Dim i As Long
    2.    For i = 0 To 10
    3.      If text1(i).text="" Then
    4.         MsgBox text1(i) & (i) & " is empty"
    5.      End If
    6. Next
    does this work ?

  4. #4
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: [RESOLVED] checkboxes

    did u try it?

    (it should )
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Re: [RESOLVED] checkboxes

    No I havent tried it yet...But one thing I want to know..what Hack has given is useful when any of the checkboxes is empty..But what I am really after is ,after I answered(checked) all of the questions ,I want to get a message "well done you did a good job"
    hope it is clear enough..

  6. #6
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: [RESOLVED] checkboxes

    VB Code:
    1. Dim i As Long
    2. Dim bChecked as Boolean
    3.  
    4. bChecked = True
    5.    For i = 0 To 10
    6.      If Check(i).Value <> vbChecked Then
    7.         MsgBox Check1(i) & (i) & " is not checked"
    8.         bChecked = False
    9.      End If
    10.    Next
    11. If bChecked Then
    12.     MsgBox "All Checked"
    13. End If

  7. #7

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Re: [RESOLVED] checkboxes

    Thanks everybody..it is done.

  8. #8
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: [RESOLVED] checkboxes

    use the click event of the check box to loop them
    VB Code:
    1. Private Sub Check1_Click(Index As Integer)
    2.     For x = 0 To Check1.UBound
    3.         If Check1(x).Value <> vbChecked Then Exit Sub
    4.     Next
    5.     MsgBox "all Checked"
    6. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  9. #9

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    Re: [RESOLVED] checkboxes

    Oh yes yours is better..
    Thanks Static

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