Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008
    Posts
    21

    Unanswered: How check/uncheck checkbox on parent form if records do or do not exist in subform

    I have a parent form which has a yes/no checkbox in the form's record source. Then in that parent form I have a sub-form. If NO records exist in the sub-form I want the checkbox to be UN checked. If records DO exist in the sub-form, I want the checkbox to be CHECKED.

    But I want this to happen as records are added or deleted from the sub-form. In other words, if the parent form is opened and no records exist in the subform then the checkbox should be unchecked. But as soon as the first record has been entered in the subform, the checkbox on the parent form should be checked. Likewise, as soon as the last record has been revoved from the sub-form, the checkbox on the parent form should be unchecked.

    What code do I need to accomplish all of this?

    Any help will certainly be appreciated.

    --Steve

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    (answered before)
    using the same query your sub form uses,

    in the ONCURRENT event of the form:
    chkBox.value = dCount("*","qsSubQry") >0

Posting Permissions

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