Solved

Alert user before allowing record updates or deletions

Posted on 2016-10-18
3
27 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
3 Comments
 
LVL 34

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now