checkbox disabled problem with ADO next record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdtam
    New Member
    • Jan 2013
    • 22

    checkbox disabled problem with ADO next record

    hello expert..

    i use ms access 2007 to store my client data..i have several checkboxes in vb6 form. my problem is if i disabled the checkbox after checked, then the next record also got disabled checkbox even they are not checked..ty for ur help..
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    In your code where you move from record to record, you need to check whether or not the checkbox needs to be disabled.

    Comment

    • mdtam
      New Member
      • Jan 2013
      • 22

      #3
      hi rabbit..thanks for reply
      let say i got 10 checkboxes(actu ally more than that)..each checkbox holds a statement. i also got a combobox which holds month from january to december..user need to select the checkbox by month.i need to disabled the selected checkbox because if not then i go to the next month(let say February) and select another checkbox..the statement from january checkbox will show again.sorry for my bad english..i hope you can understand me. Here is my poor code :)
      Code:
      Private Sub cmdSave_Click()
      
      Dim a As String
      Dim b As String
      Dim c As String
      Dim d As String
      Dim e As String
      Dim f As String
      Dim g As String
      Dim h As String
      Dim i As String
      Dim j As String
      Dim k As String
      Dim sum As String
      Dim ilength As Integer
      
      Set rs = Adodc1.Recordset
      
      
      If Check1(0) = vbChecked Then
      a = a & "human needs,"
          If Check1(0).Enabled = False Then a = ""
      
      End If
          
      If Check1(1) = vbChecked Then
      b = b & "animal needs,"
      
          If Check1(1).Enabled = False Then b = ""
      End If
          
          
      If Check1(2) = vbChecked Then
      c = c & "Plant needs,"
          If Check1(2).Enabled = False Then c = ""
      End If
          
      
      If Check1(3) = vbChecked Then
      d = d & "Food and Healthy,"
          If Check1(3).Enabled = False Then d = ""
      End If
      
      If Check1(4) = vbChecked Then
      e = e & "Visual Basic,"
          If Check1(4).Enabled = False Then e = ""
      End If
      
      If Check1(5) = vbChecked Then
      f = f & "Microsoft Access,"
      
          If Check1(5).Enabled = False Then f = ""
      End If
      
      If Check1(6) = vbChecked Then
      g = g & "Teenagers,"
          If Check1(6).Enabled = False Then g = ""
      
      End If
      If Check1(7) = vbChecked Then
      h = h & "Reproduction,"
      
          If Check1(7).Enabled = False Then h = ""
      
      End If
      
      If Check1(8) = vbChecked Then
      i = i & "Animals movement,"
          If Check1(8).Enabled = False Then i = ""
      End If
      If Check1(9) = vbChecked Then
      j = j & "Computers,"
          If Check1(9).Enabled = False Then j = ""
      
      End If
      If Check1(10) = vbChecked Then
      k = k & "Human and Robot,"
          If Check1(10).Enabled = False Then k = ""
      
      End If
      
      sum = a & b & c & d & e & f & g & h & i & j & k
          ilength = Len(sum)
          If ilength = 0 Then
          ilength = 1
          MsgBox "No topic selected!"
          End If
          Text1.Text = Left(sum, ilength - 1)
      
      Dim lines() As String, ixx As Integer
      
          lines() = Split(Text1.Text, ",")
      For ixx = 0 To UBound(lines)
          Text3.Text = Text3 & (ixx + 1) & ": " & lines(ixx) & vbCrLf
          Text3.SetFocus
      
      Next
      If Combo1.Text = "" Then
      MsgBox "Choose month first!"
      Exit Sub
      End If
      rs.Fields(Combo1.Text) = rs.Fields(Combo1.Text) & Text3.Text
      rs.Update
      
      
      End Sub

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        It's not your save code you need to change. Reread my post.

        Comment

        • mdtam
          New Member
          • Jan 2013
          • 22

          #5
          now i understand what do you mean at the first post..looks like it's work..thanks expert..will coming back if there has other issue related.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            Glad you got it working, good luck with your project.

            Comment

            Working...