Thanks S Rawson, but doing what you said affects both the subform and the
form. Maybe because they both have the same record source. Is there a way to
set the form.allowedits for form2 form the onopen event of form1? Maybe by
something like: subform.allowedits=false?
>You could add a line of code in VBA in the onopen:
>form.allowedits = true
[quoted text clipped - 4 lines]
>After Private sub...., go to a new line and type form.allowedits = true,
>ensuring End sub is on the next line.
Rick Brandt - 25 Feb 2006 15:45 GMT
> Thanks S Rawson, but doing what you said affects both the subform and
> the form. Maybe because they both have the same record source. Is
> there a way to set the form.allowedits for form2 form the onopen
> event of form1? Maybe by something like: subform.allowedits=false?
A form and subform both having the same RecordSource suggests a design flaw. Do
you have them both also displaying the same record?
By the way, you would set AllowEdits of the *subform* to false, not the
AllowEdits of the main form.
Me.SubformControlName.Form.AllowEdits = False

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
bbrazeau - 25 Feb 2006 15:51 GMT
I think I got it:
1.Problem: Had a form (form1) with a subform based on (form2) and didn’t want
user to mistakenly change data on subform. If I set (form2)s “form.
allowedits” property to no or yes, it affected both the form and subform
instances.
Solution: When editing form1, if your careful you can pick the subform close
to its edge, right click, and get properties for the subform. In these
properties you set “locked” property to true.