Solved

Alert user before allowing record updates or deletions

Posted on 2016-10-18
3
60 Views
Last Modified: 2016-10-19
I have an Access form that I added an Update (i.e. Save record) button to and a Delete record button.  I used the Command Button Wizard to create them, so the on click events have embedded macros instead of event procedures, which is throwing me off.

I'd like to give the users a chance to change their mind when they attempt to update or delete a record.

How can I accomplish this?  If the user presses the Delete button for example, I'd like to have a vbYesNo message pop up and ask "You are about to delete the displayed record. Are you sure you want to delete it?"
0
Comment
Question by:dbfromnewjersey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41849106
Use the option in the ribbon to convert the macros for a form to code.  Then you can add whatever you want.

Since delete is permanent and rare, I always prompt before deleting.  However, updating is normal so I don't prompt unless the user is changing something that doesn't normally change such as a customerID or name.  If you prompt too much, you run the risk of users simply blowing by all prompts without actually considering what they say.  Prompts should be used sparingly so they retain some level of importance.
0
 

Author Comment

by:dbfromnewjersey
ID: 41850138
Thank you.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question