Results 1 to 4 of 4

Thread: CheckBox(Resolved)

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    81

    Resolved CheckBox(Resolved)

    Hi,

    I create a form with 18 checkBox for the user to check the selected options.
    It will saved in a table in access. My coding is:

    Private Sub cmdSave_Click()
    Dim Index As Integer
    Dim status As Integer
    Dim chk As CheckBox

    Index = 0
    For Each chk In Check
    If Check(Index).Value = vbChecked Then
    status = 1
    End If
    Index = Index + 1
    Next

    If status = 1 Then
    If mode = "Add" Then
    rs_a.AddNew
    fill
    rs_a.Update
    MsgBox "One record is added"
    ElseIf mode = "Edit" Then
    fill
    rs_a.Update
    MsgBox "One record is updated"
    End If
    End If

    End Sub

    Private Sub fill()
    rs_a!ID = id.text
    rs_a!Newspaper.Value = Check(0)
    rs_a!Artile.Value = Check(1)
    rs_a!Banner.Value = Check(2)
    rs_a!CADDStudent.Value = Check(3)
    ..
    ..
    End Sub

    How can I retrieved the checked value from the table and display it back to the form by the ID??
    Please help !!
    Last edited by vivian2u; Mar 31st, 2005 at 05:26 AM.

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