|
||||||
|
|
Disallow Editing Data By Richard Rost Prevent Users from Editing or Deleting Existing Records In this Microsoft Access Tutorial TechHelp video, I'll show you how to set up your form so that users can ADD new records, but they can't EDIT or DELETE existing data. We will learn how to use the Allow Edits and Allow Deletions properties. I'll also show you how to set up a quick and simple Admin form so YOU can make changes, but your regular users can't. Hema asks, "Hi. Can you help me? How do you disable data editing after inputting values in a form? I tried locking but it is not allowing me to enter new data as well." MembersI'll show you how to set up a Main Menu form and set it as the Startup Form for the database. Learn how to disable the Navigation Pane, most of the Ribbon, and the Shortcut Menus so your users can't go poking thru your database. Learn how to ask for a PASSWORD to gain access to the Admin Menu. Plus lots more. Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today! Links
IntroIn this video, I will show you how to prevent users from editing or deleting data in your Microsoft Access forms by using the Allow Edits, Allow Deletions, and Allow Additions form properties. We'll talk about the differences between field-level locking and record-level editing, and I'll explain how you can let users add new records while restricting changes to existing ones without needing any programming. I will also discuss when to use the Data Entry property to control what users can see and add, and share a simple way to provide different access levels for regular users and administrators.TranscriptWelcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.In today's video, I'm going to show you how to disallow editing and deletion of data in your forms. We're going to look at the Allow Edits, Allow Deletes, and Allow Additions properties. Today's question comes from Hama. She says, Hi, can you help me? How do you disable data editing after inputting values in a form? I tried locking, but it is not allowing me to enter new data as well. The first thing that you have to understand is there is a big difference between field-level locking and record-level editing. Let me show you an example. If you go into design view of any form and open up the properties for a control, like a text box, you'll see on the Data tab there's Enabled and Locked. Now these properties allow you to control what happens with that specific field only. If you want to do multiple fields, you have to set them all on the form. That's handy for preventing specific things from being edited, like if you don't want any phone numbers or credit limits being changed. In order to have it so that someone can add that value and then not be able to edit it later for just that specific record, it is going to involve some Visual Basic programming. You have to have an event that locks that field after they enter the value. What it sounds to me like you're looking for is the ability for users to view data if it's already in the table but not change it, but still be able to add new records at the end of the record set. In other words, you want people to be able to open this, view what's already in here but not change this stuff, and still give them the ability to add new records. That's the most common thing that people ask me how to do. Fortunately, at the most basic level, it doesn't involve any programming. All you have to do is go into the design view and go to the form properties. That's the little box right there where the ruler bars meet. Come down here and change Allow Edits and Allow Deletions. Set Allow Edits equal to No and Allow Deletions equal to No. That way they can't delete any records either. Leave Allow Additions set to Yes. There is another field called Data Entry, which we'll talk about in a minute. Now save your form (Ctrl+S), close it down, and open it back up again. Notice if I click in here and try to type, nothing happens. I can't change any existing records, but if I go to a blank new record, I can still add stuff. The problem with this is once you leave the record and come back to it, now you can't make any additions or edits. That's what you have to deal with if you want to work with these properties. This way, your users can open up this form and can see the data, but they can't make any changes. That other property that's in there, if you go down, there's Data Entry. If you set that to Yes, that means they won't be able to see the records that are in there. That's handy if you want people doing surveys or if you want them adding order information, and you don't want them to be able to go back and look at all of the older information in the form. They can just add new records, but they can't see what's in there previously. That's what you turn on if you want to put Data Entry on. What do you do if you still want to edit this data as a manager or as the administrator of the database? Unfortunately, unless you know some Visual Basic programming, which I will cover in the members only version of this video coming up, the only way to do that without some programming is to make two copies of this form. Copy and paste. We'll make this Customer Admin F. Now you can edit this guy in design view and maybe change the background color. The problem with this method is that you have to maintain two different forms. That's too dark, so let's go with light red. So that you know this is the admin form. Now, in the properties in here, you can set Allow Edits and Allow Deletions to Yes. Close that and save it. Now if I open up the admin form, I can still make changes, but the regular customer form you cannot. You can only make additions. How do you prevent your user from seeing this stuff so they can't open up the admin form? I'll show you all that in the members only video. Here's what the members only video has. I'm going to show you how to make a quick main menu form so you can have a custom interface for your users to work with and buttons for your customer and your customer admin forms. I'll show you how to set that up as the startup form so when your database starts up, the main menu appears. Then I'll show you how to disable the navigation pane so the users can't go through all of your objects. They can't poke into your tables, forms, queries, and all that. They'll only see what you give them access to on your main menu. I'll also show you how to disable most of the ribbon buttons and the shortcut menu options so they can't just right-click on a form and close it. You can control whether or not they have a close button or give them your own close button on the form. Then I'll teach you how to do a password. Very simple. Two lines of code. Pop up an input box and then check the password. The password allows them to open the admin form. Then finally we'll get rid of that admin form because we don't want two separate forms to maintain. If you make changes in one, you have to remember to change them in the other. I'll show you, using that same code that we used to ask for a password, how to change the Allow Edits and the Allow Deletions properties in code so you can use the same form and just control the access rights to it. And again, altogether it's like five or six lines of code and you can do all this stuff with it. How do you get access to the members only videos? You have to join my YouTube channel. Go to my channel and click on the Join button. You'll see all the different membership levels there from Supporter and up. Silver members and up get access to all of the extended cut members only TechHelp videos. There's a video there explaining what all the different membership levels give you. But do not worry. I'm always going to be making these free TechHelp videos and posting them on my YouTube channel and my website in the future. You do not have to subscribe to watch all of these free videos. But make sure you do subscribe to my channel. That means you get notifications. It doesn't cost you anything. Make sure you click on the little bell there to get email notices whenever I release new free videos. You can also subscribe to my website's Access forum. If you want to see your questions answered in a video like this, you can visit my TechHelp page where you can post them in the comments section below the video. There's all my other cool stuff: my blog, Facebook, Twitter, YouTube. I've got a free three hour long full tutorial for Microsoft Access Beginners on my website and it's on YouTube. There's a link. If you like level one, level two is just one dollar. That will also give you a logon on my website, which gives you all kinds of extra cool stuff. Thank you for watching. I hope you learned something and we'll see you next time. QuizQ1. What is the primary purpose of the Allow Edits property on a Microsoft Access form?A. To allow users to edit data in specific fields only B. To control whether users can edit any existing data in the form C. To allow users to add new records to the form D. To prevent users from seeing any records in the form Q2. If you want users to be able to view existing records but only add new records (not edit or delete existing ones), how should you set the form properties? A. Allow Edits: Yes, Allow Deletions: Yes, Allow Additions: Yes B. Allow Edits: No, Allow Deletions: No, Allow Additions: Yes C. Allow Edits: Yes, Allow Deletions: No, Allow Additions: No D. Allow Edits: No, Allow Deletions: Yes, Allow Additions: No Q3. Which form property prevents users from deleting records? A. Allow Edits B. Allow Deletions C. Allow Additions D. Data Entry Q4. What happens if you set the Data Entry property to Yes on a form? A. Users can see and edit all records B. Users can only see existing records, but cannot edit them C. Users can only add new records, but cannot see previous records D. Users can delete existing records but not see new ones Q5. What is the difference between field-level locking and record-level editing? A. Field-level locking affects all forms, record-level editing affects one form only B. Field-level locking controls editing for the whole record, record-level editing controls individual fields C. Field-level locking allows settings for specific fields, record-level editing allows settings for all data in a record at once D. There is no difference; both are the same thing Q6. What is a limitation of using two separate forms (such as a user form and an admin form) for different access levels? A. Only one form can be open at a time B. Changes in one form are automatically applied to the other C. You have to maintain both forms if changes are needed D. You cannot set different properties for each form Q7. What programming technique is mentioned in the video for locking specific fields after data entry? A. Using macros in Access B. Setting Allow Edits to No in form properties C. Writing Visual Basic code for specific field events D. Changing the Record Source of the form Q8. If Data Entry is set to Yes, which of the following statements is true? A. Users can see and edit all records as usual B. Users can add new records but cannot see any existing records C. Users cannot add new records at all D. Users can edit existing records but not add new ones Q9. According to the video, how can administrators or managers gain access to edit data if a standard form has Allow Edits set to No? A. By using a different user login B. By creating a duplicate (admin) form with Allow Edits set to Yes C. By exporting data to Excel for editing D. By unlocking fields on the form during use Q10. What additional feature is discussed in the members only video for offering different levels of access using one form? A. Using passwords and Visual Basic code to set Allow Edits and Allow Deletions properties dynamically B. Using macros to hide the form from users C. Disabling the Save button on the form D. Printing access reports for each user Answers: 1-B; 2-B; 3-B; 4-C; 5-C; 6-C; 7-C; 8-B; 9-B; 10-A DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks. SummaryToday's video from Access Learning Zone covers how to prevent editing and deletion of data within your Access forms. The focus is on understanding the Allow Edits, Allow Deletes, and Allow Additions form properties and how they affect user interaction with data.A common question I receive, like the one from Hama, is how to stop users from changing data in a form once it has been entered, but still allow them to add new records. Locking individual fields through the Locked property stops editing for those specific fields, but it also prevents users from entering new data unless you manage each control one by one. This approach is helpful when you want to protect particular fields, such as phone numbers or credit limits, from modification. If you want a situation where users can see existing data but cannot modify it, yet retain the ability to add new records, this can be configured entirely through the form's properties without requiring any programming. In form design view, open the form properties and set Allow Edits and Allow Deletions to No. Leave Allow Additions set to Yes. As a result, users will be unable to modify or delete existing records but will still be permitted to add new records at the end of the form. There is also a property called Data Entry. Setting Data Entry to Yes will hide all existing records from the user, allowing only the addition of new entries. This is particularly useful for scenarios like surveys where you do not want users to have access to previously entered data. Now, if you are an administrator and need to edit records, but you do not want general users to have that ability, the simplest non-programming solution is to duplicate the form. For example, you can create a form called Customer Admin F and distinguish it, perhaps by changing the background color. In the admin form, set Allow Edits and Allow Deletions to Yes so administrators can make changes. Regular users would use the original form, which only allows additions. The drawback of this method is maintaining two separate forms, which can be inefficient if you need to update layouts or features later on. To hide the admin form from regular users or to create more sophisticated controls, some Visual Basic for Applications (VBA) programming is required. In the members only video, I walk through building a main menu form that provides users with buttons to access customer and admin forms. I explain how to assign this menu as the startup form so it automatically appears when the database opens. I also demonstrate how to disable the navigation pane and most ribbon commands, restricting user access to only the parts of the database you want them to use. This prevents users from exploring or altering tables, queries, and forms not meant for them. Additionally, I show how to simplify closing forms, such as by adding your own close button rather than relying on the built-in one. In the extended content, I present a way to secure the admin form with a password, using a minimal amount of code to prompt for and check the password before granting access to edit records. To streamline administration further, I explain how to eliminate the need for duplicate forms altogether. Instead, you can use VBA to set the Allow Edits and Allow Deletes properties dynamically. This means you keep only one form and control access based on the user's role or password entry. To access this extended members-only content, you'll need to join my YouTube channel at the Silver level or higher, which also unlocks dozens of other extended cut TechHelp videos. There is a video explaining the differences between membership levels if you want more details. Regardless of membership, all the basic TechHelp videos remain free on my YouTube channel and website. Subscribing to my channel is free and ensures you receive notifications about new content when it's released. For more discussion or to submit your own questions, you can visit my website's TechHelp page or join the forum. If you're new to Microsoft Access, there's also a free three-hour beginner tutorial available both on my site and my YouTube channel. Level two is just one dollar and unlocks even more content and features on my website. You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends. Topic ListDifference between field-level locking and record-level editingUsing Enabled and Locked properties on form controls Setting Allow Edits property on a form Setting Allow Deletes property on a form Setting Allow Additions property on a form Effect of Allow Edits and Allow Additions on user input Using Data Entry property to hide existing records Creating separate admin and user forms for access control Copying and modifying forms for different user roles |
||||
|
| |||
| Keywords: TechHelp Access Disallow Edits Allow Edits Allow Deletions Main Menu Startup Form Password Inputbox lock record lock order PermaLink Disallow Editing Data in Microsoft Access |