Deselect check box on form closing

D

Deb Smith

Is it possible to automatically have a selected check box revert to an
unchecked state when the form is closed. If so how would you do this?

Any suggestions would be appreciated
 
E

Ed Robichaud

Sure; you could use the form's "on close" event to run something like:
Me!myCheckbox = 0

-Ed
 
L

Larry

I assume the checkbox is linked to a field in a table, othewise it wouldn't
matter if it was checked or not when closed.

In the Unload even of the form, execute some code to set that field to
False. I tend to use SQL for this, but I know other's prefer to do it with
Access code directly. The main thing is putting it in the Unload event,
which is executed when the form is closed.
 
D

Deb Smith

Thanks for the suggestions. I have used the following and it works.

DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE MailList SET Selected = False;"
DoCmd.SetWarnings True

Once again thank you for taking the time to respond.
 

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

Top