Friday, November 18, 2016

Deletion Warning

Reinforce

After a while, the warning that a record will be deleted becomes routine.
Here’s the code to create your own notice:

  1. Open the database, and click Macros under Objects.
  2. Click New.
  3. Right-click the macro title bar and select Conditions. (In Access 2002+, click the Conditions button in the Macro toolbar.)
  4. Click in the first Conditions cell and enter the following:
    MsgBox("Do you really want to delete the record?"273,"Delete")<>1
  5. Click in the Action cell and enter CancelEvent.
  6. Click in the next Condition cell.
  7. Enter an ellipsis (...).
  8. Press [Tab].
  9. Enter StopMacro.
  10. Click in the next Action cell.
  11. Enter Keystrokes.
  12. Under Action Arguments, click in the Keystrokes box and click [Enter].
  13. Close and save the macro as ConfirmDelete.
  14. Open the form in design view, then right-click the form and select Properties.
  15. On the Event tab, click in the On Delete property box and select ConfirmDelete
Create a new warning for Access record deletion



See all Topics

No comments: