Unanswered: Clear Yes/No Field when opening a form
I have created a form that will allow the user to check off who they would like the report to preview. But when the form opens up again the checks are still there. How can I refresh or requery the form that will show all checkboxes clear when the form is re-opened.
I read an article that informed me to use an update query which works but I can't seem to automate that without the prompt.
Originally posted by mfernandez
Yes, this form is bound to a query.
Hey, I also have that same situation with a database I just created. I did use the UpdateQuery, but really hate having to click the buttons about 2-4 times. My Yes/No is based on a table and then to the query. How can you clear them out in Code? Please say exactly how to place the code to use it. I have seen something about creating functions, but not understood just how to activate the function once it is created.
Thanks and have a nice one
Here is an easier way using the example by mfernandez.
Private Sub Form_Open(Cancel As Integer)
Dim Str as String
Str = "UPDATE WIANotesSpecifyTable "
Str = Str & "SET WIANotesSpecifyTable.[WIANotesY/N] = False "
Str = Str & "WHERE (((WIANotesSpecifyTable.[WIANotesY/N])=True));"
currentdb.Execute Str, dbFailOnError
'May or may not need this.