Results 1 to 3 of 3
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Set subform AllowEdits property from another form

    When my form that contains two subforms is opened from certain other forms, I want to disallow edits on one of the subforms and on the parent.
    My code:



    Docmd.openForm "ParentName"
    Forms!ParentName.AllowEdits=False
    This only works for the parent-the subforms still allow edits (something that affects totals on the Parent)

    I added:
    Forms!ParentName.Form.Child2Name.AllowEdits=False

    which gives me an error message.

    I am using A2007 with W7.

    I know that I can open the whole form as read-only, but would like child1 to be available for editing. I have searched, and found things that I thought would apply, but am missing something. Any help much appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Give the subform container controls names different from the forms they hold, like ctrChild2Name, then try:
    Forms!ParentName.ctrChild2Name.Form.AllowEdits=Fal se
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Thanks much-As soon as I saw your proposed expression I realized that I had put "Form" and the subform name in the wrong order. You probably thought that I had just made a typo, but, sad to say, typo was in brain. Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Visible property in subform columns
    By MDB in forum Forms
    Replies: 3
    Last Post: 09-03-2011, 06:46 PM
  2. AllowEdits in Subform
    By Jackie in forum Forms
    Replies: 3
    Last Post: 03-02-2011, 10:51 AM
  3. Property Managment Form
    By JennyHunt in forum Forms
    Replies: 0
    Last Post: 03-02-2011, 08:30 AM
  4. Form combo box not working with AllowEdits = False
    By jgelpi16 in forum Programming
    Replies: 3
    Last Post: 02-04-2011, 05:08 PM
  5. Change form property with VBA
    By jmk909er in forum Forms
    Replies: 1
    Last Post: 10-20-2010, 08:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums