Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform Problem (A2K SR1)

    I have a form with a subform. For some reason, I can't get the subform to allow me to enter new records when opened with the main form. When I view the subform separately, apart from the main form, it works perfectly...I get the Append record indicator and am allowed to enter new records. However, the same subform acts differently when opened inside the main form. I can view subform records...however, I can't add new records. I'm not presented with the Append record indicator. I've spent hours trying to fix this, but I can't find out why this is happening. Any suggestions would be greatly appreciated. Thank you.

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    Do you have code in the main form that change the Allow Addition of the subform ?
    Did you try to Compact & Repair the database ?
    Francois

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Subform Problem (A2K SR1)

    Can you change info on existing records within the subform?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    Francois, I'll check on the Allow Addition code. I don't believe so.

    Mark, no, I cannot edit current records using the subform within the main form. Outside of the main form, yes, I can edit exisiting records using the subform. But in the main form, no.

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    If you can't edit, check also if the enable property of the subformcontrol (not the form) is set to yes and the locked property to No.
    Francois

  6. #6
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    For the subform, Enabled is set to Yes and the Locked property set to No. I think I checked every possible control for both the main form and subform today. Obviously, I missed something, though!

  7. #7
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    If you want and if the data is not sensitive, you can attach the db so we can have a look at it.
    If it's to big, you can send it to my email (address in my profile), I can have a look at it tomorrow.
    Francois

  8. #8
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    Thanks, Francois. The db is about 15MB. I'll see if I can e-mail it to you tomorrow.

  9. #9
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    Please compact and repair, and zip it before you send it.
    Francois

  10. #10
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    Will do. Thanks.

  11. #11
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Subform Problem (A2K SR1)

    Unless you've done something from the mainform (as Francois suggested) to disallow additions, you apparently have something in your subform's recordset that is making the query non-updatable. Just a thought, are you referring to the subform by its form name anywhere? That is, using Forms!Formname syntax.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  12. #12
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    With Francois' help, I fixed the problem. My form has an Edit Record button that prevents casual users from modifying data in a record until the button is pressed. This button uses the AllowAdditions, AllowEdits, and AllowDeletions properties of the main form. I mistakenly thought these properties would also carry over to the subform. I was wrong. After I'd enter a record in the main form, it would update and reset these 3 properties to No before I got to the subform, effectively disabling the subform. I did not know before today that on a form with a subform, when the focus moves from the form to the subform, the main form is updated. I tweaked my AllowAdditions, AllowDeletions, and AllowEdits code to accommodate this behavior and I think I'm good to go. Thanks for your suggestions and help.

  13. #13
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Subform Problem (A2K SR1)

    FWIW, when I have code that will manipulate the subform's properties, I often put them on the subform control's OnEnter and OnExit events. This way I can easily find them (instead of having to look in a variety of other places).
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  14. #14
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    Thanks, Mark. Would that help me here? As I said, I have an Edit Record button on the main form. Could I somehow use the subform's OnEnter and OnExit events to control the AllowAdditions, AllowDeletions, and AllowEdits of the subform? I'm not satisfied with the code I have right now in the OnUpdate event of the main form. It works, but it's ugly. Is there a cleaner way?

  15. #15
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (A2K SR1)

    You could put a save button on your form and put your allowadditions and alloweditions in this button after you have save the record (Docmd.RunCommand accdmsaverecord).
    You should also prevent the moving to next, previous and new record as long as Me.Dirty (record not saved) or Me.subformcontrolname.form.dirty are True.
    Francois

Page 1 of 2 12 LastLast

Posting Permissions

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