Reinforce
After a while, the warning that a record will be deleted becomes routine.Here’s the code to create your own notice:
- Open the database, and click Macros under Objects.
- Click New.
- Right-click the macro title bar and select Conditions. (In Access 2002+, click the Conditions button in the Macro toolbar.)
- Click in the first Conditions cell and enter the following:
MsgBox("Do you really want to delete the record?"273,"Delete")<>1 - Click in the Action cell and enter CancelEvent.
- Click in the next Condition cell.
- Enter an ellipsis (...).
- Press [Tab].
- Enter StopMacro.
- Click in the next Action cell.
- Enter Keystrokes.
- Under Action Arguments, click in the Keystrokes box and click [Enter].
- Close and save the macro as ConfirmDelete.
- Open the form in design view, then right-click the form and select Properties.
- On the Event tab, click in the On Delete property box and select ConfirmDelete
See all Topics
No comments:
Post a Comment