Results 1 to 3 of 3

Thread: [RESOLVED] A Big problem with CheckBox array

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Resolved [RESOLVED] A Big problem with CheckBox array

    Hi All

    I looking on this Forum and didn't find this what i want
    I have the array of checkbox's. All it be placed on a one form. They make possible choosing any configurations to calculations for user.
    However not all they are accidental but some this create an dependence.

    So, I want to make it.
    For e.g. If I made vbChecked let's say for chk(1) which I have named The Cars, then should be also
    made vbChecked let's say for chk(5) named Porshe and let's say for chk(10) named Jeep.

    But....If I will want to make vbUnchecked for chk(10) this example, then I should can to do it.
    The statement of condition it will not here useful.
    Because then can't - in reference to above mentioned example - to make chk(10) vbUnchecked without switch off this chk(1).
    Simply I want I has it a dependent in one direction but in a second direction already no
    I hope it will good understood

    Someone know how to make it, thanks in advance for some help me
    Last edited by Tamgovb; May 19th, 2007 at 06:22 AM.
    I know, I know, my English is bad, sorry .....

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: A Big problem with CheckBox array

    What is wrong with this?

    Code:
    Private Sub chk_Click(Index As Integer)
    
        Select Case Index
            Case 1
                If chk(1).Value = vbChecked Then
                    chk(5).Value = vbChecked
                    chk(10).Value = vbChecked
                End If
        End Select
    
    End Sub

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2005
    Location
    in Poland
    Posts
    390

    Re: A Big problem with CheckBox array

    Thanks Martin

    Orginally posted by Martin Liss
    What is wrong with this?
    No, nothing in this has wrong.

    I thought about the statement of condition as about single procedure - obviously for this example. I will admit, that I didn't thought about CASE procedure. However using with your prompt at last I made it so. It fine work.

    Code:
    Dim lValue As Long
    lValue = chk(Index).Value
    Select Case Index
    
      Case 1
        chk(5).Value = lValue
        chk(10).Value = lValue
      End Select
      
    End Sub
    Because in your example it didn't vbUnchecked for those controls (in your code: chk(5)) and chk(10) when I make switch off with return on a vbUnchecked for chk(1) control's
    I know, I know, my English is bad, sorry .....

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