J
Jeff Byrd
We have an Undo Button on a data entry form for deleting a the entry if a
mistake is made so they can start over. After the data is entered we have a
Next Record Button programmed to allow them to enter the next record.
If the Undo button is clicked after the Next Record Button is clicked but
before they start entering a ne record it will delete the last record
entered even though it no longer shows on the form. This has caused some
records to be deleted by mistake. The user thought they were deleteing an
empty record.
Here is the code for the Undo Button:
Private Sub cmdUndoRecord_Click()
On Error GoTo Err_cmdUndoRecord_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Exit_cmdUndoRecord_Click:
Exit Sub
Err_cmdUndoRecord_Click:
MsgBox Err.Description
Resume Exit_cmdUndoRecord_Click
End Sub
Here is the code for the Next Record Button:
Private Sub cmdNextShowing_Click()
On Error GoTo Err_cmdNextShowing_Click
DoCmd.GoToRecord , , acNewRec
Forms!frmEagleMain!fsubMainSetShowing.Requery
Exit_cmdNextShowing_Click:
Exit Sub
Err_cmdNextShowing_Click:
MsgBox Err.Description
Resume Exit_cmdNextShowing_Click
End Sub
How can I have a Undo Button but not have it delete the last record that is
no longer showing on the form?
mistake is made so they can start over. After the data is entered we have a
Next Record Button programmed to allow them to enter the next record.
If the Undo button is clicked after the Next Record Button is clicked but
before they start entering a ne record it will delete the last record
entered even though it no longer shows on the form. This has caused some
records to be deleted by mistake. The user thought they were deleteing an
empty record.
Here is the code for the Undo Button:
Private Sub cmdUndoRecord_Click()
On Error GoTo Err_cmdUndoRecord_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Exit_cmdUndoRecord_Click:
Exit Sub
Err_cmdUndoRecord_Click:
MsgBox Err.Description
Resume Exit_cmdUndoRecord_Click
End Sub
Here is the code for the Next Record Button:
Private Sub cmdNextShowing_Click()
On Error GoTo Err_cmdNextShowing_Click
DoCmd.GoToRecord , , acNewRec
Forms!frmEagleMain!fsubMainSetShowing.Requery
Exit_cmdNextShowing_Click:
Exit Sub
Err_cmdNextShowing_Click:
MsgBox Err.Description
Resume Exit_cmdNextShowing_Click
End Sub
How can I have a Undo Button but not have it delete the last record that is
no longer showing on the form?