Results 1 to 3 of 3

Thread: checkbox count

  1. #1
    Join Date
    Dec 2003
    Posts
    36

    Question Unanswered: checkbox count

    Hi,

    I have a form (with a subform in it)
    in the subform i have a checkbox.
    ToDo: Count the records where the checkbox is checked.
    I've tried a query: criteria: -1 , true but it doesnt work

    all help appreciated!

    greetz
    daff
    ... man man man ...

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: checkbox count

    Originally posted by daff
    Hi,

    I have a form (with a subform in it)
    in the subform i have a checkbox.
    ToDo: Count the records where the checkbox is checked.
    I've tried a query: criteria: -1 , true but it doesnt work

    all help appreciated!

    greetz
    daff
    If your checkBox is called myCheck then use
    if myCheck then
      'Code to count the Records
    end if

    If you check it while you are in a Report or other Form then use


    if forms!formNameContainsTheCheckBox!myCheck then
      'Code to count the Records
    end if

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    okee doekee....heres the code you are looking for.:

    Dim NumChecked as Long
    NumChecked = DCount("[NameOfMyCheckBoxInTable]", "myTableName", _
    "[NameOfMyCheckBoxInTable] = TRUE")

    'To Prove It...
    MsgBox"There are " & NumChecked & " records that have " & _
    "my checkbox set as True"




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •