Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Delta, Br. Columbia
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I am using MS Access 2003. I have a form on which there is a sub form and then another sub form inside the first one.

    I am trying to use the Open with Edit when the user can Edit and ReadOnly when they cannot. The problem I am having is that the use of these arguments changes the subform control properties re allow Edits, allow deletions and allow Additions on what appears to be a permanent basis. To be, I hope, more specific when the Form and subforms are opened acFormReadonly the Allow properties are all set fo No on both sub forms. However when I then try and open the form with acFormEdit these subform properties are not changed back to Yes.

    I have tried actually setting the subform properties directly inside the more major form (i.e. Form and subform1) but that only works if there are records to be displayed in the subforms. (me.subform.form.allowedits = true). If I am trying to enter a new master record to then add the sub records I get an error message saying the the allowedits property is not (yet?) available to change.

    According to the Help on the subject the mode used to open the form should override any of the form allow properties. I am wondering if this does not apply to subforms?

    Can anyone help?

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    The problem you are facing is that if you are entering a new master record, the subform hasn't actually been loaded until you enter the subform control on the main form. I think you will need to set those properties from the subform using info from the master form.
    Wendell

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I have just been testing this with a little demo db (with a form and a single subform) and the problem you describe does not happen for me.

    Look at the attachment to see if it sheds any light.

    [attachment=88005:formsandsubforms.zip]
    Attached Files Attached Files
    Regards
    John



  4. #4
    2 Star Lounger
    Join Date
    Jan 2002
    Location
    Delta, Br. Columbia
    Posts
    116
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you both for your comments. I had a look at your sample John and it does exactly what I would expect. What I do not understand is why the properties of the sub-sub-form )and sometimes the sub-form) get changed when the overall form is opened acFormreadOnly and then not changed back when it is opened acFormedit. In your example the properties do not change not matter how the form is opened. As I understand it acForm??? should not change the form/subform properties, just override them.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    My understanding matches yours, so I don't know why my example behaves the way we both expect, and yours does not.

    My only suggestion is for you to post a simple example that displays the behaviour you experience. Maybe someone can find something else going on there.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •