CheckAll Checkbox

PWORTHY

New member
Local time
Today, 03:30
Joined
Jul 17, 2014
Messages
7
:banghead:

I have a filtered subform that has a check box on each record. I want to be able to use an unbound checkbox to select all and have that selection updated in the table for each associated record. Any suggestions?

:banghead:
 
Loop over the subform's recordsetclone. Set the value of the field bound to each record's checkbox as desired
 
I have tried the following, but I can't get it to work:

Private Sub cmdMark_Click()
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 rst![Ckbx2] Then
rst![Ckbx2] = False
Else
rst![Ckbx2] = True
End If
rst.Update
rst.MoveNext
Loop
MsgBox i & " Records Marked."
rst.Close
Set rst = Nothing

End Sub
Run-time error '3265':
Item not found in this collection.

highlights:
If rst![Ckbx2] Then

Do you see something wrong?
 
Last edited:
Run-time error '3265':
Item not found in this collection.

Translated into English: WTF is ckbx2? :D

Your subform does not have any field in its recordset named like that.
 
OK.. now I feel like an idiot!!! LOL
Ckbx2 = CheckBox2, I was trying to use the checkbox instead of the actual name of the field. one of the "Duh!" moments!! Thanks!!!!!!!
 

Users who are viewing this thread

Back
Top Bottom