Uncheck Records

  • Thread starter Thread starter Ladybird
  • Start date Start date
L

Ladybird

Would like to uncheck all records from a continuos form using a control
button when queries have run.
 
I assume that the check box is bound to a field in the subform's recordset.
If so, run an update query on the recordset.

Example:
strSQL = "UPDATE TableName SET TableName.FieldName = False WHERE (apply the
restrictions to limit the records to the ones in the subform here);"
CurrentDb.Execute strSQL, dbFailOnError
 
Hi there,
Below is an example of what the 'on click' event code might look like for
the command button (called cmdNone). For the purposes of this exercise I've
assumed there's a table called tblRecords and a Yes/No type of field called
Flag.

Private Sub cmdNone_Click()

Dim stSQL As String

stSQL = "UPDATE tblRecords SET tblRecords.Flag = 0;"

DoCmd.SetWarnings False
DoCmd.RunSQL stSQL
DoCmd.SetWarnings True

Me.Requery

End Sub

Hope this is of help to you.

Lee
 
Back
Top