DenBurt,
Thank you for you help. I had to play with it a little bit to get it to work, but it works and I am happy.
Because I am using ADO, I received a datatype error on the declaration of the recordset. So, I included ‘Microsoft DAO 3.6 Object Library’ in my references and changed the declaration to:
Dim rs As DAO.Recordset
Then I received Run-time Error 320 – ‘Update or CancelUpdate without AddNew or Edit. So, I had to add a rs.Edit and rs.Update. I also had to add a rs.MoveFirst so that I could click the checkbox more than once and get the desired results.
The only bad thing is that because I have 215 items in my list the form flickers for about 3 seconds while all the rows are updated. But it does what it is suppose to do.
Here the final code:
-
Private Sub SelectAll_AfterUpdate()
-
-
Dim tmpcontrol As Controls
-
Dim bSelectAll As Boolean
-
Dim rs As DAO.Recordset
-
Set rs = Me.RecordsetClone
-
rs.MoveFirst
-
-
bSelectAll = Me.SelectAll.Value 'Checkbox in the Form Header
-
-
If Not rs.EOF Then
-
Do Until rs.EOF
-
rs.Edit
-
rs!Select = bSelectAll
-
rs.Update
-
rs.MoveNext
-
Loop
-
End If
-
-
End Sub
-