Originally Posted by
June7
Are those checkboxes bound to a field? Won't work with unbound checkbox - checkbox will have the same value.
They're bound to the area table field "CheckToClear".
I was thinking of using some code I found:
Code:
Function TickOnOff(FormName As String, FieldName As String, TickBoxName As String)Dim RecordSourceName As String
Dim Switch1 As String
Dim MySql As String
RecordSourceName = Forms(FormName).RecordSource
Switch1 = Forms(FormName).Controls(TickBoxName).Value
MySql = "UPDATE " + RecordSourceName + " SET " + RecordSourceName + "." + FieldName + " = " + Switch1 + ";"
DoCmd.SetWarnings False
DoCmd.RunSQL MySql
DoCmd.SetWarnings True
Forms(FormName).Controls(TickBoxName).Requery
End Function
If I exchange the fields for mine, and the forms for mine as well as the criteria for the update. Really I want to clear the date field in the tblSchools that correlate with the same AreaID that is in the areas table (the main form with the checkboxes).