Solved

Subform and checkbox reset

Posted on 2004-09-14
2
282 Views
Last Modified: 2006-11-17
I have a checkbox on a form that when a user marks or checks, a pop-up subform is made visible.  I need to know how to code the following:
 
a)  reset the checkboxes on the main form and the subform when the user exits the particular record or go to the next record (i.e. uncheck all boxes).

Currently, I have the following code for the
Private Sub MyCheckbox_AfterUpdate()
 If Me.MyCheckbox.Value = True Then
      Me.MySubform.Visible = True
       
      End If
End Sub
0
Comment
Question by:emacyam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
domj earned 100 total points
ID: 12061793
The 'on Current' event is the one that you want (Form_Current()). Set your checkboxes to False on this event and they will reset every time a new record becomes Current Record.

Dom
0
 
LVL 11

Assisted Solution

by:Mighty_Silly
Mighty_Silly earned 50 total points
ID: 12071232
The code for resetting the check box would be placed on the form's On_Current event as Dom mentioned:

 Me!MyCheckbox = false   ' This forces the chkbox to false
 Me!MySubform.Visible = false  ' This forces sub-form to be invisible

You didn't mention any other validation so the above will Blank out the check box and make subform invisible EVERYTIME you move off the current record (by going to the next record or new record.)

Hope this helps!
-Silly-
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question