undo form additions with sub-forms

Ask a Question related to Microsoft Access, Design and Development.

  1. #1

    Default undo form additions with sub-forms

    Hello,
    Using Office XP, (Access 2002)
    The scenario is a master/detail form.
    Once the master has been updated And the detail (sub-form)
    then the command:
    DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, ,
    acMenuVer70
    Generated by the button wizard, no longer works?
    The record changes are not undone...
    Any suggestions?
    Thanks in advance,
    Andrew
    Andrew Guest

  2. Similar Questions and Discussions

    1. Text Area Additions
      I was wondering if anyone else has been trying to do this? I want a Text Area that will do thesaurus and spell checking on the fly. Currently I...
    2. Main form and login form in different folders using Forms Authen
      Having a problem on my site when the login form and the main form are in different apps. When the main app redirects to the login form app,...
    3. keeping track of new additions to your scene
      Say I have a racetrack and different types of cars that get swapped in and out on a mousedown action. Is there a way to store ONLY the new models...
    4. Additions to Thumbnails Files
      I have created files containing thumbnails in Photoshop, but have lost the files containing the original images. Now I would like to add some new...
    5. Can't use UNDO in form design mode
      When I am in form design mode using Access XP, my "Edit/Undo"UNDO" function in the toolbar is grayed out. How can I enable that command? It worked...
  3. #2

    Default Re: undo form additions with sub-forms

    On Sun, 20 Jul 2003 08:54:00 -0700, "Andrew" <diplodop@aol.com> wrote:
    >Hello,
    >Using Office XP, (Access 2002)
    >The scenario is a master/detail form.
    >Once the master has been updated And the detail (sub-form)
    >then the command:
    >DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, ,
    >acMenuVer70
    >Generated by the button wizard, no longer works?
    >The record changes are not undone...
    >Any suggestions?
    The problem is due to the way subforms have to work: typically a
    Subform is bound to the "many" side table of a one to many
    relationship. If (as should be the case) relational integrity is
    enforced on this relationship, it is impossible to create a record on
    the subform until the mainform record is actually saved to disk.

    When you setfocus to a subform, the main form record is therefore
    saved to disk. It's too late to undo it; in addition, as you move off
    each subform record to a new subform record, it's also written to
    disk. You can't "undo" it because it's no longer just on the form - it
    has already been written out, and made available to any other user of
    the database.

    To "undo" it you will need to run a Delete query to delete the
    mainform record; if cascade delete is set on the relationship, this
    deletion will also delete the second table's records. If you don't
    have cascade deletes set you will need TWO delete queries, one to
    delete from the subform's recordsource, the other from the mainform.

    If this isn't acceptable, you may want to consider having the Forms
    bound to temporary tables rather than the "real" table; you'ld write
    code to copy the updated records from temp to real at an appropriate
    moment (perhaps a commmand button).

    John W. Vinson[MVP]
    Come for live chats every Tuesday and Thursday
    [url]http://go.compuserve.com/msdevapps?loc=us&access=public[/url]
    John Vinson Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139