Unlock subform

  • Thread starter Thread starter Matthew Reed via AccessMonster.com
  • Start date Start date
M

Matthew Reed via AccessMonster.com

I have a form called Rent Amounts with a subform on it called Rent Amounts
Subform. When the main form is opened, I want both forms to be locked.
In Design View, I've set the Allow Edits property of the Rent Amounts form
= No, and same with the Rent Amounts Subform.

I've used a Macro with a SetValue command to set the value of the
Rent Amounts form to Yes, which works. What's the syntax to set the value
of the subform's AllowEdits property to Yes? Is that all I need to do to
be able to edit data?

Thanks for any help.

MBR
 
The syntax to do it depends on where you are doing it from. To refer to a
property of the subform from the main form the syntax would be:

Me!ctlNameOfSubformControl.Form.AllowEdits = True

The ctlNameOfSubformControl is not the name of the subform, although it may
be the same. It is the name of a control on the main form called a subform
control. This is a container control that holds the subform.
 
Thanks. I actually don't have much VBA coding experience, so I'm trying to
do this in Macros. I did check the name of the subform control on the main
form, and yes, it is the same name as the subform (Rent Amounts Subform).
Good point.

Using your tip, I got it working! I was trying to manipulate the
AllowEdits property of the subform...I instead tried working with the
Locked property of the subform control using the SetValue action in a Macro
and got it.

Thanks!
MBR
 
Back
Top