Change subform properties from parent form

cavscout

Registered User.
Local time
Today, 00:31
Joined
Mar 13, 2003
Messages
74
I have a subform in an form that on open checks some criteria and if true changes the AllowEdit property to False. If the user wants to modify the data on the form or subform they click a button and I want to change the AllowEdit property back to True for both the form and subform.

The button is on the form and when it is clicked the parent form works but the subform is still protected. When I try to change the property on the subform it tells me this is not supported for this object. Is there a way to change the property on the subform from the parent form?

Thanks in advance.
 
Try this.

Forms!YourParentForm!YourSubForm.Enabled = False

Does this do what you want?
 
A Subform object doesn't have an Allow Edits property. I have something very similar set up and I use the Locked property of the subform object to accomplish the task.
 
I've got a feeling you can still delete records with a locked sub-form. I could be wrong.....
 
Thanks for all the input.

I wound up putting a cmd button on the subform that the user will click to modify the detail data. Then after the user submitts the form I open the report for them to print and close the form in the background. If the user opens the form again the allowedits is reset to false on open. Kind of the long way around but almost transparent to the user.

It did seem, based on what I tried it was easy to communicate from the subform to the form but very difficult to talk to the subform from the form.

One interesting fact was that if a field is has the locked property set to Yes, and you allowedits to the form the field remains locked. I like that!

Thanks for everyones thoughts!
 
You're right, you can delete records from a locked subform. Thanks for the info. =)
 

Users who are viewing this thread

Back
Top Bottom