Disabling subform

paulig2001

Registered User.
Local time
Today, 03:03
Joined
Apr 12, 2005
Messages
13
Is there any way I can disable a subform in my main form until the user has entered some data in the main form and thereby created a primary key?

If the user decides to enter data in the subform first it gives an error and obviously I don't want this!
 
SubFormControls have enabled and locked properties.
 
So is there a way of un-enabling the subForm when you change to a new record? I don't see a function in the main form's event tab that would do this, as in an OnNewRecord() function. Is there something else that would do the job?

I would imagine that the BeforeInsert() function would be best for re-enabling the subForm?
 
The Current event fires every time you move to a different record. You could use the NewRecord property to determine if the SubForm should be disabled. I would probably use the AfterInsert event to enable the SubForm. Use the BeforeInsert event to validate whatever fields need validating.
 

Users who are viewing this thread

Back
Top Bottom