Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Alert user before allowing record updates or deletions

Posted on 2016-10-18
3
Medium Priority
?
66 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 39

Accepted Solution

by:
PatHartman earned 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 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