acCmdUndo 3 different behaviors!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dantebothermy
    New Member
    • Nov 2008
    • 47

    #1

    acCmdUndo 3 different behaviors!!

    The application I'm developing allows the user to edit fields. If a field has changed when the user clicks on a different control (or another record in the multi-record subform), a messagebox gives the user the option to save, undo or cancel. The problem is with the undo:

    I'm testing it with repeated edits in a single field; I edit the field, click on another control or record and select undo ("no"). The first time, the undo works fine.

    I edit the field again and click elsewhere, select undo from the message box and I get an error that "the command or action undo isn't available".

    I cancel the error message dialog box and edit the field again, click elsewhere. This time the undo deletes the entire edited field.

    Please help.

    All of the data and the code are in a subform:

    Private Sub Form_AfterUpdat e()
    Dim intYesNo As Integer
    intYesNo = MsgBox("Yes to Save, No to Delete Record", vbQuestion + vbYesNoCancel, "Enter")
    If intYesNo = vbYes Then
    DoCmd.DoMenuIte m acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    ElseIf intYesNo = vbNo Then

    'the debugger brings me to this line when I get the error message
    DoCmd.RunComman d acCmdUndo
    End If
    End Sub
  • dantebothermy
    New Member
    • Nov 2008
    • 47

    #2
    More question related to the last question.

    I have also tried to use Me.undo in the subform, instead of acCmdUndo. When I test it in the subform as a free-standing form it works fine. But when I test it in the subform as part of the "master form" it does NOTHING.

    Ideas?

    Thanks

    Comment

    Working...