Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    173

    Unanswered: Determine if a Subform is in Edit Mode

    How do I determine if a SubForm is in Edit Mode or not?


    If I can figure out how to see if a subform is in edit mode, I can solve the problem I am having...

    (it is a long procedure to explain all of it here, so the basics are provided)

    Here is the Issue - I have a Main Form with a few SubForms

    When I am in Edit Mode on a SubForm, and if I open another Form that Runs an Update on the Data, I get an Error Message on the Requery Event....


    frmInventory - Main Form

    frmInventoryItemsSF - SubForm with Inventory Items

    (there are also other SubForms, but not needed for this issue)


    In the OnActivate Event I have a statement that requeries the SubForm

    Me.frmInventoryItems.Requery


    Another form, where stock is ordered, runs an update - all works fine if the FrmInventory is Closed, or even if it is Open - UNLESS I am editing a record on it that is affected by the update...


    then I get

    Runtime Error 2118
    You must save the current field before you run the requery action


    This is an .ADP file, but the functionality should be the same using an .MDB File.

  2. #2
    Join Date
    Mar 2004
    Location
    Berlin, Germany
    Posts
    107
    have a look at the "Dirty" Property of the subform. it tells you whether data in a form has been changed

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    Then perhaps simply save the field (record) before the Requery.

    DoCmd.RunCommand acCmdSaveRecord



  4. #4
    Join Date
    Aug 2004
    Posts
    173

    This is what I did to Solve the Issue

    Quote Originally Posted by CyberLynx
    Then perhaps simply save the field (record) before the Requery.

    DoCmd.RunCommand acCmdSaveRecord



    I did just this and it resolved the issue - it does restrict the User from using an "Undo" command, but it is better than the error message!!!

    AB

Posting Permissions

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