Delete all records on close

G

Gee...

I have a continuous form with bound check box to choose parts to be added to
a report.
I need to have all the check boxes to become False when the form is closed.
When I ask for that, it only works for the current form, not all the others.
Is there a way to delete all records on close?
I've tried Add=False (it only works on the current record, not the others)
I've tried making the Default value False (didn't work at all)

Thank you in advance for any help.
Gee
 
O

Ofer Cohen

If you want to update all the records in the table to False, create update
query

UPDATE TableName SET TableName.YesNoFieldName = False
*********
And then run this code from the UnLoad event of the form

CurrentDb.Execute("QueryName"), dbFailOnError
*********
Or, without creating query you can run this SQL
CurrentDb.Execute("UPDATE TableName SET TableName.YesNoFieldName = False"),
dbFailOnError
*********

Note: Just to make that what you want, this SQL will update all the records
in the table regardless to what you have in the form
 
G

Gee...

Ofer Cohen said:
If you want to update all the records in the table to False, create update
query

UPDATE TableName SET TableName.YesNoFieldName = False
*********
And then run this code from the UnLoad event of the form

CurrentDb.Execute("QueryName"), dbFailOnError
*********
Or, without creating query you can run this SQL
CurrentDb.Execute("UPDATE TableName SET TableName.YesNoFieldName = False"),
dbFailOnError
*********

Note: Just to make that what you want, this SQL will update all the records
in the table regardless to what you have in the form
 
G

Gee...

PERFECT!
I ran the SQL and it did exactly what I needed done!
Thank you so much!
 
Top