RE: Cancel a New Record

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: TinleyParkILGal (TinleyParkILGal_at_discussions.microsoft.com)
Date: 10/26/04


Date: Tue, 26 Oct 2004 13:33:02 -0700

Folks, this achieved my results. I took code from the undo button and I had
to add the code on error to take the user back to the first record as if the
user pressed the cancel button before putting in a field of a new record, the
user got an error that the undo feature was not available.

Thanks for your help.

Private Sub cmdDump_Click()
On Error GoTo Err_cmdDump_Click

    DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
    DoCmd.GoToRecord , , acFirst
    
Exit_cmdDump_Click:
    Exit Sub

Err_cmdDump_Click:
    DoCmd.GoToRecord , , acFirst
    Resume Exit_cmdDump_Click
    
End Sub

"TinleyParkILGal" wrote:

> I have a form on which I have a command button to add a new record. If a user
> is in the middle of adding a record and decides not to pursue the new record,
> how do I code to allow the user to dump the record without having to hit
> escape? Perhaps a command button that says "cancel new record"...I wouldn't
> want this button to delete any other records as the users are not allowed to
> delete other records from this database. Thanks in advance.

"TinleyParkILGal" wrote:

> I have a form on which I have a command button to add a new record. If a user
> is in the middle of adding a record and decides not to pursue the new record,
> how do I code to allow the user to dump the record without having to hit
> escape? Perhaps a command button that says "cancel new record"...I wouldn't
> want this button to delete any other records as the users are not allowed to
> delete other records from this database. Thanks in advance.



Relevant Pages

  • RE: Error: SaveRecord isnt available now (urgent)
    ... I created a new database and imported all the objects from the ... RunCommand acCmdSaveRecord ... Private Sub cmdSave() ... Do the same thing for your Undo button. ...
    (microsoft.public.access.formscoding)
  • Re: Cant Undo Macro Command
    ... "Dave Peterson" wrote: ... If you were writing a generic Undo procedure, you'd have to keep track of the ... Dim myRngToCopy As Range ... ' Specify the Undo Sub ...
    (microsoft.public.excel.programming)
  • Re: Cant Undo Macro Command
    ... If you know that the style will always be calculation, you don't need to store ... If you were writing a generic Undo procedure, you'd have to keep track of the ... Dim myRngToCopy As Range ... ' Specify the Undo Sub ...
    (microsoft.public.excel.programming)
  • RE: User Saving a Record else it deletes
    ... The code I posted simply does not undo if the user clicks no, ... > or tries to exit. ... >> Make a Cancel button on the form, ... >> End Sub ...
    (microsoft.public.access.forms)
  • RichTextBox and multi-level Undo
    ... I recently needed a multi-level undo feature for my editor module, ... What I've read suggests that you need two stacks: ... Private Sub Form_Load ... Private Sub Form_Unload ...
    (microsoft.public.vb.controls)