Solved

Alert user before allowing record updates or deletions

Posted on 2016-10-18
3
47 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 35

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
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 …

856 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