Hide Subform if criteria is met

KarenS

Registered User.
Local time
Today, 09:30
Joined
Nov 12, 2005
Messages
31
Hi,
I have a main form which has a subform with another subform in it. Subform 1 gives details of a loan and a balance field which is calculated in subform 2 after amt paid is entered - using a macro on exit.

If the balance is zero after amt paid is entered. I want the amt paid field in subform 2 to be locked or disabled - preventing the user from entering further payments by mistake.

How can I do this?
 
You likely will have a problem hiding or disabling subform2 since when you enter data in that form and the condition is met a control on that form will have focus.

Anyway, the general expression for referencing 2 subforms would be as follows:

MainForm!FirstSub.form!SecondSub.form
 
I realize that it is kinda tricky..but what expression or criteria do I use and where do I enter it?
 
Hi KarenS

You should enter the expression on the main form in the Current Event

The expression:

If MainForm!FirstSub.form!SecondSub.form!MyControl = MyCondition
then MainForm!FirstSub.form!SecondSub.form!MyControl.Enabled = False
Endif
 
Thanks for you help.. but I did finally get through using conditional macros!
 

Users who are viewing this thread

Back
Top Bottom