Editing Sub forms When Parent form Allow edits is set to false 
Author Message
 Editing Sub forms When Parent form Allow edits is set to false

Hello,
I have a form in Access 2000 where the allow edits propery is set to
false, but I want the subform to be able to editable.  However the
subform is taking the properties of its parent. Further, when I try to
set the sfrms  allow edits property to true using the following code:-

[Forms]![frmresourcebooking]![sfrmResourceBookingLogEdit].AllowEdits =
True

I get this error message.

Object Does Not Support This Propery Or Method

Please help.



Sat, 16 Jul 2005 23:35:59 GMT  
 Editing Sub forms When Parent form Allow edits is set to false


Quote:
> Hello,
> I have a form in Access 2000 where the allow edits propery is set to
> false, but I want the subform to be able to editable.  However the
> subform is taking the properties of its parent. Further, when I try to
> set the sfrms  allow edits property to true using the following code:-

> [Forms]![frmresourcebooking]![sfrmResourceBookingLogEdit].AllowEdits =
> True

> I get this error message.

> Object Does Not Support This Propery Or Method

> Please help.

The message is because you need "Form." between the subform control name &
the AllowEdits:

[Forms]![frmresourcebooking]![sfrmResourceBookingLogEdit].Form.AllowEdits =
True

(The subform control does not have an AllowEdits property. It is the form
*within* that control, which has that property.)

You could also just say:

Parent![sfrmResourceBookingLogEdit].Form.AllowEdits = True

("Parent", from a subform, refers to the main form. This avoids having to
code-in the name of the main form.)

But I'm not sure if it *works* to set AllowEdits for a subform when the main
form has it false. If not, as an alternative, set AllowEdits = True for
both, but also set each editable control on the main form to Locked = True.
This prevents those controls from being edited, even though AllowEdits is
true.

HTH,
TC



Sun, 17 Jul 2005 10:33:08 GMT  
 Editing Sub forms When Parent form Allow edits is set to false
That works great.

Thanks!!!

Quote:
> The message is because you need "Form." between the subform control name &
> the AllowEdits:

> [Forms]![frmresourcebooking]![sfrmResourceBookingLogEdit].Form.AllowEdits =
> True

> (The subform control does not have an AllowEdits property. It is the form
> *within* that control, which has that property.)

> You could also just say:

> Parent![sfrmResourceBookingLogEdit].Form.AllowEdits = True

> ("Parent", from a subform, refers to the main form. This avoids having to
> code-in the name of the main form.)

> But I'm not sure if it *works* to set AllowEdits for a subform when the main
> form has it false. If not, as an alternative, set AllowEdits = True for
> both, but also set each editable control on the main form to Locked = True.
> This prevents those controls from being edited, even though AllowEdits is
> true.

> HTH,
> TC



Sun, 17 Jul 2005 16:08:26 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Set Fields in Main Form and Sub Forms to Allow Edits

2. Can't edit form where Allow Edit set to Yes

3. Please help-Urgent: Form allows edits- when .AllowEdits = false

4. form allow edits false except for a combo box

5. Add SubForm records while Don't allow edits on Parent form

6. Please help-Urgent: Form allows edits- when .AllowEdits = false

7. Need to save edits on form1 to allow edits on form 2

8. Allow Edits on Sub Form

9. Allow Edits on Access 97 sub forms

10. Source Object in sub forms, allow edits problem and Access Lies


 
Powered by phpBB® Forum Software © phpBB Group