Results 1 to 3 of 3
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486

    Select check box for all records not marked archived

    I would like to have a button (or check box that uses the after update event) that will allow me to select all records that have not been marked archived and then select them.

    I know how to select all of the records and mark them

    SelectAll "myTable", Me.SelectAllChk (SelectAllChk is the checkbox control name)

    What I cant figure out is how to add a where clause to that

    SelectAll "myTable" Where Archive = "True", Me.SelectAllChk does not work.

    Any ideas?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I don't know what "SelectAll" is or does, but the SQL to select all records in table "myTable" that have not been marked archived would be
    Code:
    SELECT * FROM myTable WHERE [Archive] = False
    IF
    [Archive] = True means record was/is archived
    [Archive] = False means record was not /is not archived...

  3. #3
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    486
    I was not able to use SelectAll so I had to iterate the records using RecordsetClone
    Dim rst As Recordset, i As Integer


    Set rst = Me.RecordsetClone
    i = 0
    rst.MoveFirst
    Do While Not rst.EOF
    i = i + 1
    rst.Edit
    If Archived = False And rst![Select] Then
    rst![Select] = False
    Else
    rst![Select] = True
    End If
    rst.Update
    rst.MoveNext
    Loop
    MsgBox i & " Records Marked."


    rst.Close
    Set rst = Nothing

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 18
    Last Post: 06-20-2014, 12:13 PM
  2. Multi Select Check Boxes?
    By CDavis10 in forum Forms
    Replies: 2
    Last Post: 07-19-2013, 07:04 AM
  3. Replies: 3
    Last Post: 03-14-2012, 12:33 PM
  4. Check my Select Statement in Form
    By OMGsh Y did I say Yes in forum Forms
    Replies: 12
    Last Post: 12-07-2010, 02:13 PM
  5. Replies: 2
    Last Post: 03-20-2010, 11:08 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
  •  
Other Forums: Microsoft Office Forums