Disable / Enable Subform

RowanG

New member
Local time
Today, 23:00
Joined
Jan 11, 2011
Messages
8
Hi All,

I need some help. I have a main form with a single subform. I want to enable / disable (and make invisible) that subform using a check-box on the main form.

That I can do - Using the Current category on the MainForm and the AfterUpdate category on the Check-box.

My problem is, that as soon as you navigate around the records, it screws it up.

What I actually want is for the Database to check if the checkbox is checked or "Yes" and based on that result enable / disable the subform (thus getting around the problem when navigating through the records). The checkbox is automatically set to No.

Any thoughts?

Thanks
Rowan
 
For brevity only

Subform.visible = me.checkbox

So if the checkbox is checked it is visible and if not invisible.

You will also need to put the same code on the click event of the checkbox
 
Hi David,

Thank you for your help, I haven't done any coding for a long time so I am struggling here.

The checkbox is called:

chkDetection

and the subform is called:

Residue Analyses Subform.

If i use this code:

Residue_Analyses_Subform.Visible = me.chkDetection

Should this work? Presumably putting it in the OnClick (Checkbox) and OnCurrent (Main Form)?

Thank you
Rowan
 
There's only one way to find out? isn't it.
 
Remember too, you must use the name of the subform CONTROL (control on the main form which HOUSES the subform) and not the name of the subform itself, unless they share the exact same name.
 

Users who are viewing this thread

Back
Top Bottom