1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: MS Access Select All Checkboxes in Subform

Discussion in 'Business Applications' started by mariaa33, May 27, 2009.

Thread Status:
Not open for further replies.
  1. mariaa33

    mariaa33 Thread Starter

    Joined:
    Aug 7, 2008
    Messages:
    164
    I have a form with a datasheet subform. The Subform has a field "SA" that is a checkbox. I have put a command button on the main form that will check the checkbox of all the records that appear on the datasheet subform. I have the following code which works for all the records in the subform for the first record in the main form but will not work on any other records. I also would like to be able to deselect all as well if needed. Here is my code.
    Code:
    Private Sub CheckSA_Click()
    Dim rs As DAO.Recordset
    Set rs = Forms![Chronics Edit]![Data Subform Simple].Form.RecordsetClone
    Do While Not rs.EOF
    rs.Edit
    rs!SA = True
    rs.Update
    rs.MoveNext
    Loop
    Set rs = Nothing
    End Sub 
    
     
  2. mariaa33

    mariaa33 Thread Starter

    Joined:
    Aug 7, 2008
    Messages:
    164
    I figured it out by adding

    Forms![Chronics Edit]![DATA Subform Simple].Form.Requery
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/830459

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice