disabling subforms whenever needed

saleemMSMS

Registered User.
Local time
Tomorrow, 04:38
Joined
Aug 12, 2009
Messages
92
hi
i have 2 tables

25i21ad.gif


here, the Village Main table stores information of all the villages in the system. while some villages don't have details which are mentioned in the village sub table. so, in the village sub only details of some villages are stored.

now i have a form with Village main's attributes in it. also the village sub form is included as a sub form.

say the DEO is entering data of a village which does not have details to be entered to the village sub table, in this case, i'm planning to have a check box to disable the sub form. but how can i do that ???
please suggest any better ways.. and in detail please..

if the question is not clear, please let me know..
 
You could test the contents of your check box and make the subform's Visible property either True or False to suit.

Check this link for the correct syntax for refering to SubForma and their properties.

Code:
If Me.CheckBoxName.Value = -1 Then [COLOR="Green"]'Checked returns as -1 or "True"[/COLOR]
 	Me!Subform1.Form.Visible = True
Else
 	Me!Subform1.Form.Visible = False
End If
You will need to put this code in the main form's On Current Event as well.
 

Users who are viewing this thread

Back
Top Bottom