Delete all records on close

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top