Share via

Select all checkboxes using a filtered form

Anonymous
2010-07-02T02:07:59+00:00

I have a form that is based on a query.  The form has checkboxes that are checked when the user wants to add the items from the underlying query to another table.  Sometimes the user filters the form (which is displayed as a continuous form) to find several items that need to be added.  Instead of them having to check every box that is listed with each record, I would like to have a way for them to select all of the checkboxes that are visible on the form.  I just have no idea where to start with this even though I have been using Access for quite some time.  Any ideas?  Thanks in advance.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2010-07-02T03:19:48+00:00

SG,

I think the problem is the space in the field name.  Change the code to:

![On Scope]


Steve Schapel, Microsoft Access MVP

Was this answer helpful?

0 comments No comments

6 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-07-02T02:36:33+00:00

    SG,

    I haven't tested, but I think this would work, on the Click event of a Command Button in the form Header...

       With Me.RecordsetClone

          Do Until .EOF

             .Edit

             !YourYesNoField = True

             .Update

             .MoveNext

          Loop

       End With


    Steve Schapel, Microsoft Access MVP

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2010-07-02T03:17:45+00:00

    Sorry to not be more specific.  Yes, I did replace the "YourYesNoField" with the actual name and left the ! in front of it. 

    Here is the code I have:

    Private Sub Command36_Click()

    With Me.RecordsetClone

          Do Until .EOF

             .Edit

             !On Scope = Yes

             .Update

             .MoveNext

          Loop

       End With

    End Sub

    Thanks!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2010-07-02T02:53:26+00:00

    SG,

    You mean you replaced the "YourYesNoField" with the actual name of the field in your table?  And preceded it with a ! ?

    Can you cut/paste your code to show us exactly what you put?


    Steve Schapel, Microsoft Access MVP

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-07-02T02:43:12+00:00

    That was a quick response!  Thanks!  I put the code in the click event of a command button in the form header as you said.  However, when I click the button, I get a Compile Error:  Syntax Error.  The Line that references My YesNo Field is highlighted.  I don't know VB well enough to know what this means...but I did double check to make sure I had the correct field name...

    Was this answer helpful?

    0 comments No comments