A family of Microsoft relational database management systems designed for ease of use.
A toggle button's value will be TRUE or FALSE depending on whether it's 'up' or 'down', so you could have code like this in its AfterUpdate event procedure along these lines:
Dim strSQL As String
With Me.ActiveControl
strSQL = "UPDATE tblSchedule SET scheduleArchive = " & .Value
Me.Dirty = False
CurrentDb.Execute strSQL, dbFailOnError
Me.Refresh
.Caption = IIf(.Value, "Set all NO", "Set all YES")
End With
The toggle button's Caption property would be Set all YES by default in its properties sheet. If the caption is currently showing Set all YES when clicked then the scheduleArchive column for all rows in the table would be set to TRUE, and the caption would change to Set all NO. If then clicked the scheduleArchive column for all rows in the table would be set to FALSE. You can of course have whatever captions you wish by amending the code and the control's default Caption property accordingly.
Note that the code ensures that the current record is saved by setting the form's Dirty property to False before executing the UPDATE statement to avoid any conflict.
One thing to note when adding a toggle button to a form is that if you switch in and out of design view its last Value property will be retained, so the code might do the opposite of what's expected the first time clicked. In normal use this won't happen of course, but it's something to be aware of when testing the form at design time.