Check / Uncheck All

  • Thread starter Thread starter WSF
  • Start date Start date
W

WSF

Access97
I have a continuous form based on a table.
One of the fields [Checked] in the table [tblPartsList] is a Yes/No (-1,0)
and is bound to a Checkbox control [chkChecked] on the form [frmPartList]
(or visa versus)!
I would like to place a check box at the top of the form control which when
OnClicked will either check all the Checkboxes on the Continuous form or
conversely Uncheck them - all at once - depending on their state..
Is this possible?
I presume it involves opening the table recordset to change all records and
then refreshing the form?

TIA

WSF
 
Thank you Allen
Thank's to you I've got it going at last!.

Regards,
Bill Fraser


Allen Browne said:
Private Sub chkDoEmAll_AfterUpdate
Dim strSQL As String

'Save any edits to avoid concurrency issues.
If Me.Dirty Then
Me.Dirty = False
End If

strSQL = "UPDATE MyTable SET Checked = " & _
Me.chkDoEmAll.Value & " WHERE Checked = " & _
Not Me.chkDoEmAll.Value & ";"

dbEngine(0)(0).Execute strSQL, dbFailOnError

'Requery the form.
Me.Requery
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to the newsgroup. (Email address has spurious "_SpamTrap")

WSF said:
Access97
I have a continuous form based on a table.
One of the fields [Checked] in the table [tblPartsList] is a Yes/No (-1,0)
and is bound to a Checkbox control [chkChecked] on the form [frmPartList]
(or visa versus)!
I would like to place a check box at the top of the form control which when
OnClicked will either check all the Checkboxes on the Continuous form or
conversely Uncheck them - all at once - depending on their state..
Is this possible?
I presume it involves opening the table recordset to change all records and
then refreshing the form?
 
Back
Top