Hello Fred:
Haven't had a chance to get back to work on this until today. Here is
my code:
Private Sub Check33_AfterUpdate()
End Sub
Private Sub Check33_Click()
CurrentDb.Execute "UPDATE [qryDelivery] SET [Print] = Not [Print],
dbFailOnError"
End Sub
When I click on the checkbox in the header I get:
Runtime error '3144:'
Syntax error in update statement.
When I click on individual records in toggles the checkbox in the
header however.
Any thoughts?
jim
** The CheckBox (Check33) should NOT be bound to any field.
In other words, it's control source should be blank.
** The [Print] check box field should be a Yes/No field in your TABLE.
** Place the code in the CheckBox AfterUpdate event.
My code should toggle all of the [Print] check boxes. If the check box
in a record is true it becomes false. If it was false it becomes true.
Is that what you want?
Or did you want to turn all of them False? or True?
To toggle those that are True to False, and those that are False to
True:
CurrentDb.Execute "UPDATE [YourTableName] SET [YourTableName].[Print]
= Not [Print], dbFailOnError"
To set all [Print] checkboxes to False:
CurrentDb.Execute "UPDATE [YourTableName] SET [YourTableName].[Print]
= 0, dbFailOnError"
To set all [Print] CheckBoxes to True:
CurrentDb.Execute "UPDATE [YourTableName] SET [YourTableName].[Print]
= -1, dbFailOnError"