Solved

Subform and checkbox reset

Posted on 2004-09-14
2
277 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
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now