Checkbox help?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sreekandan
    New Member
    • Nov 2006
    • 98

    Checkbox help?

    Now im using the check box to select the several items.In that I want to insert all the Checked items into the database by clicking one command button.So, how can I inset all the checked items into the database ?.So kindly ayone answer me with the example codings.
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by sreekandan
    Now im using the check box to select the several items.In that I want to insert all the Checked items into the database by clicking one command button.So, how can I inset all the checked items into the database ?.So kindly ayone answer me with the example codings.
    just use control array and one for loop inside that usr your qury to insert or update

    Comment

    • sreekandan
      New Member
      • Nov 2006
      • 98

      #3
      Originally posted by hariharanmca
      just use control array and one for loop inside that usr your qury to insert or update
      I have no idea about that, So please send me the example codings.

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by sreekandan
        I have no idea about that, So please send me the example codings.

        copy and past the check box and it will ask for create array give yes and use this type of code.


        Private Sub Command1_Click( )
        Dim i As Integer
        For i = 0 To UBound(chkContr olArray)
        If chkControlArray (i).Value = Checked Then
        'Your Qry
        End If
        Next i
        End Sub

        Comment

        • sreekandan
          New Member
          • Nov 2006
          • 98

          #5
          Originally posted by hariharanmca
          copy and past the check box and it will ask for create array give yes and use this type of code.


          Private Sub Command1_Click( )
          Dim i As Integer
          For i = 0 To UBound(chkContr olArray)
          If chkControlArray (i).Value = Checked Then
          'Your Qry
          End If
          Next i
          End Sub
          I have written the following code
          Code:
           Private Sub Command2_Click()
          Dim i As Integer
          For i = 0 To UBound(chkControlArray)
          If chkControlArray(i).Value = Checked Then
          con.Execute "insert into Table(t1)values('" & List1.Selected & "')"
          End If
          Next i
          End Sub
          But the compile error occured as "Argument not optional".
          So kindly reply me

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by sreekandan
            I have written the following code
            Code:
             Private Sub Command2_Click()
            Dim i As Integer
            For i = 0 To UBound(chkControlArray)
            If chkControlArray(i).Value = Checked Then
            con.Execute "insert into Table(t1)values('" & List1.Selected & "')"
            End If
            Next i
            End Sub
            But the compile error occured as "Argument not optional".
            So kindly reply me

            where its showing that error

            Comment

            • sreekandan
              New Member
              • Nov 2006
              • 98

              #7
              Originally posted by hariharanmca
              where its showing that error
              while run that program that error is showing

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by sreekandan
                while run that program that error is showing

                Private Sub Command2_Click( )
                Dim i As Integer
                For i = 0 To UBound(chkContr olArray)
                If chkControlArray (i).Value = Checked Then
                con.Execute "insert into Table(t1)values ('" & List1.Selected & "')"
                End If
                Next i
                End Sub

                You gave
                list1.Selected
                its need selected index
                list1.Selected( index)

                Comment

                Working...