Share via

Changing the "Data Entry" form property using code

Anonymous
2011-03-12T04:18:19+00:00

Hi All,

I am creating a 2010 database.  I have a main form and a subform.  I'd like to change the "Data Entry" property of the subform from "Yes" to "No" using code when I click a button on the main form.  For the life of me I can't work out how to modify the subform properties from the main form.

Can anyone help??

Stefanos

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
2011-03-12T06:02:20+00:00

mySubformControlName.Form.DataEntry = Not mySubformControlName.Form.DataEntry

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. ScottGem 68,830 Reputation points Volunteer Moderator
    2011-03-12T23:33:21+00:00

    While Tom answered you, I question the value of doing so. The main purpose of a subform is to display records related to the main form. So I can't see why you would set the Data Entry property of a subform to Yes in the first place. If you don't want users to edit existing records, then set the Allow Edits property to No.

    Was this answer helpful?

    0 comments No comments