Clear a ckbox on a form when I close the form.

SFCMatthews

Registered User.
Local time
Today, 03:28
Joined
Feb 3, 2012
Messages
44
Hello all,
I have a form that has a button that opens a appendquery form. What I would like to do is add a close button to the appendqueryfrm that will close and clear the ckboxs that are on it. Any ideas?
 
Is this just a group of unbound check boxes on a form that you want to clear?

Or is it a check box bound to a table field and you want to update the table and set the field to False for those records?
 
Its bound to a student table I have two ckboxs one in the studenttable and one in the rostertable which is where I store the history of a students attendence. I use the appendqueryfrm to update the attendance roster for the class. SO once I have finshed with giveing attendance credit I would like the ckboxs on the studenttable to clear when I click a close button..
 
You can run an Update query in the Click event of your Close button. You'll need to use some criteria of course so only the specified records get updated. Generically, it would look something like this (air code);

Code:
Private Sub cmdClose_Click()

Dim strSQL As String

strSQL = "Update StudentTable Set YesNoField = False Where StudentID = x"

CurrentDb.Execute strSQL, dbFailOnError

DoCmd.Close acForm, Me.Name

End Sub
 

Users who are viewing this thread

Back
Top Bottom