CheckAll Checkbox (1 Viewer)

PWORTHY

New member
Local time
Yesterday, 19:59
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:
 

spikepl

Eledittingent Beliped
Local time
Today, 02:59
Joined
Nov 3, 2010
Messages
6,142
Loop over the subform's recordsetclone. Set the value of the field bound to each record's checkbox as desired
 

PWORTHY

New member
Local time
Yesterday, 19:59
Joined
Jul 17, 2014
Messages
7
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:

spikepl

Eledittingent Beliped
Local time
Today, 02:59
Joined
Nov 3, 2010
Messages
6,142
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.
 

PWORTHY

New member
Local time
Yesterday, 19:59
Joined
Jul 17, 2014
Messages
7
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

Top Bottom