Delete records on form close

Sean O'Halloran

Registered User.
Local time
Today, 18:22
Joined
Dec 25, 2002
Messages
52
Dear Experts,

I became intrigued with a function which Pat Hartman posted in her "BoundDenormalizedForm" zip some time ago, and I worked on this variation.

I am trying to mimic the look and feel of a series of checkboxes. By virtue of Pat Hartman's query magic each check box creates a separate record. If the user checks ONLY the relevant box or boxes, the right records are created. BUT, if the user checks a box and and then unchecks it, a record is created with the value 0, and that "empty" record remains. I'd like to delete those records when the user closes the form...my problem is that I don't know how to write the code that would go back and delete any of those records. Any advice would be greatly appreciated.

May I suggest to anyone who is interested that they look at Pat's original database; she explains the structure much better than I can. Here's the link to Pat's original work:

http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=11716&d=1132710000

My work is in the "Checkbox_test" zip below.

Thank you for your generous help,

Sean O'Halloran
 

Attachments

Last edited:
What's wrong with doing this after the update?

CurrentDb.Execute "DELETE * FROM YourTableName WHERE YourCheckboxName=0;"
 
Thanks! I'll give it a try and post back...

Sean
 

Users who are viewing this thread

Back
Top Bottom