I have 2 forms; one for editing data and another for viewing the same data.
Both forms contain the same subform. I'd like to dynamically set the
ALLOWEDITS etc. properties on the subform based on each main form. How would
I do this?
Thanks.
Damon Heron - 11 May 2007 20:08 GMT
In the main forms' load events, put
Me!yoursubformname.Form.AllowEdits = False 'or true if it is the form for
editing
HTH
Damon
>I have 2 forms; one for editing data and another for viewing the same data.
> Both forms contain the same subform. I'd like to dynamically set the
[quoted text clipped - 3 lines]
>
> Thanks.
Marshall Barton - 11 May 2007 20:41 GMT
>I have 2 forms; one for editing data and another for viewing the same data.
>Both forms contain the same subform. I'd like to dynamically set the
>ALLOWEDITS etc. properties on the subform based on each main form. How would
>I do this?
You will probably be better off placing the code in the
subforms:
Me.AllowEdits = (Parent.Name = "edit form's name")

Signature
Marsh
MVP [MS Access]
Damon Heron - 11 May 2007 20:51 GMT
that's why yer an MVP. Very elegant solution, Marsh.
Damon
>>I have 2 forms; one for editing data and another for viewing the same
>>data.
[quoted text clipped - 7 lines]
>
> Me.AllowEdits = (Parent.Name = "edit form's name")