Force Change Password
By Richard Rost
3 years ago
Enforce Regular Password Updates in MS Access
In this Microsoft Access tutorial, discover how to enhance database security by enforcing periodic password changes, ensuring users update their credentials every 30 or 90 days. A must-watch for maintaining robust user-level security protocols.
Marina from Arlington Heights, Illinois (a Platinum Member) asks: I've been using your user-level security tips in my database for some time now, and the higher-ups at my company would like to know if it's possible to force users to change their password every 30 or 90 days or so. Thanks.
Prerequisites
Links
Recommended Courses
Up Next
Keywords
TechHelp Access 2016, Access 2019, Access 2021, Access 365, Microsoft Access, MS Access, MS Access Tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, Enforce Password Changes, Periodic Password Updates, User-Level Security, 30 Days Password Update, 90 Days Change, Automated Password Change, Database Credential Updates, Compliance Security Standards, Enhanced Security Features, User Security Compliance, Regular Password Renewal, Database User Authentication, Expiry Enforcements, Security Policy Implementation, Account Security, Tips, Change Requirements, Mandatory Update, Administration.
Intro In this video, we'll talk about user security in Microsoft Access and I'll show you how to force users to change their password at regular intervals, such as every 30, 60, or 90 days. We'll discuss why you might want this feature, modify the user table to store password change dates, create a password change form, and use VBA to check when password updates are required during login. This is a developer-level tutorial and assumes you are familiar with user-level security and basic VBA programming in Microsoft Access.Transcript Well, welcome to another TechHelp video brought to you by AccessLearningZone.com. I'm your instructor, Richard Rost.
In today's video, we're going to talk about user security. I'm going to show you how to force users to change their passwords every 30 days, 60 days, 90 days, or whatever interval you want. I wish it was this easy to get them to change the odor, but that's a whole different video.
Today's question comes from Marina in Arlington Heights, Illinois, one of my Platinum members. Marina says, "I've been using your user-level security tips in my database for some time now, and the higher-ups at my company would like to know if it's possible to force users to change their password every 30 or 90 days or so. Thanks."
Well, yes, of course, Marina. It's your database. You can do whatever you want with it. If you want to force them to change their passwords, you can. Personally, I think it's unnecessary to force users to change their passwords unless you're aware of some kind of security breach. If your password is secure, your password is secure. Why make me change it? I don't know.
But I'll show you how to do it. We all know the higher-ups are always the ones making the smart decisions, so it's usually a stack of people that are, but anyway, here we go.
Before we get started, if you have not yet watched my user-level security video, go watch this. It gives you simple tips for making security in your database. It's not perfect, but it's good enough for most office environments. I show you how to build a little logon form like this. Go watch this first and then come back.
Yes, this is a developer-level video, which means we are going to be programming in VBA. If you've never done any VBA before, go watch this video first. It's about 20 minutes long and teaches you everything you need to know to get started. So go watch those and then come on back.
I am going to head on over to the user-level security page, and down in the member section here, I'm going to download the database from that video. If you're a Gold member, go right ahead and download it. If not, go watch this video and build that database. I'm a Gold member on my own site, so I can grab the database.
Let's open that database up. There it is, and it starts up locked. In the other video, I show you how you can lock this down a little bit better, making an ACCDE file, for example, so your users can't just do this: right-click, design view. But that's how we can get into it.
Since we want to be able to make them change their password, let's say every 30 days, we need a place to store that. Let's close this. Let's go into the user table here.
We have username and password. We need to add a date so we know when they last changed the password. Let's make it "DateChanged." This will be a date, and I'm going to leave the default value blank. If it's null, if there's no value, or if this date is less than 30 days ago, then we can force them to change their password. Save that and close it.
Now I'm going to make another form that I'm going to use. That's going to have two password boxes on it. So, password one and password two. They have to match, and then your password gets saved.
I've got another form that is very close to what I want, and that happens to be our logon form. So let's copy and paste that and let's call this our password change form.
Right-click, design view. I made the Access window a little bit bigger here.
That's a little bit better. Let's make this like a dark blue. Let's just change the color a little bit, maybe that.
We're going to make this password one, and make this one password two.
Let's change the names. This guy over here is going to be password one - no space in here, right, password one - and this guy will be password two.
This one has the input mask on it. Data, yes, input mask, password. We'll just copy that, come back up here, and put it on that, so now they're both password fields.
We'll change this button here so it's "Update" or whatever.
We'll come back and work on this in a minute. Save this form, close it.
Let's go into our logon form. Right-click, design view. Let's take a look at our logon text. Right-click, build event. That will bring up our code builder.
Here we go. We have ID, we have password. We look up the username to get the ID in the table. We then look up the password to see if they match. If we get down to this point, then we're successfully logged on, right here. Successful logon.
Now, after we set their TempVar username, we're going to make sure that their password isn't at least 30 days old. Check for password change requirement.
Let's look up the date that they last changed their password. We need a variable up here: DateChanged as Date. That can be the same name as the field in your table. That's fine; nothing wrong with that.
Down here, we're going to look up that value from the table. So DateChanged equals - now, it could be null. If this is their first time logging on, we haven't given them yet, so they have to change their password the first time. This is also kind of nice because then you can just give them a temporary password and then they immediately have to put in a real one.
That's kind of what I do on my website, although I don't force the user to change it. If they want to keep that temp password, fine.
This is going to be NZ (null to zero), right? DLookup. If you haven't used NZ or DLookup, I've got courses and videos on those on my website or YouTube channel. Go watch those.
If you're watching this, I assume you know all this stuff because we did it in the last video.
What are we looking up? DateChanged. Where are we getting it? UserT. Whenever I think of DLookup, I always think of - what do we want, where are we getting it from, when do we want it, right now. What do you want, where are you getting it from, and then how do you want it, scrambled, over easy, whatever. What are your criteria? UserName equals, and remember this is a string, so it's got to be double quotes and then quotes, and then what is the user's username? You could either get it out of the text box there or still grab the TempVar. I like the TempVar. UserName.
We have to close it up. We have to put the close quotes on the end of the username.
Now that's the end of our DLookup combo. We have to take into consideration null values now. If there is no DateChanged, if it returns a null value, what value do you want to put in here? We'll just put something ridiculously old in here, like 11/1990. Yes, even though I use the ISO dates (year-month-day) for my Windows settings and for everything else, for some reason VBA doesn't like that. Note to Access team: get on that. I want to use ISO dates in here. That's my Windows system setting. It's annoying every time.
That is going to do it for part one, folks. Tune in tomorrow, same bat time, same bat channel, for part two.
If you enjoyed this video, please give me a thumbs up and post any comments you may have below. I do try to read and answer all of them as soon as I can.
Make sure you subscribe to my channel, which is completely free. Click the bell icon and select All to receive notifications when new videos are posted.
Want to learn more? Click the Show More link below the video to find additional resources and links. YouTube does a pretty good job of hiding it. It's right down there. The name of the video is up here. There's a little Show More down there at the bottom. It's kind of hard to find. Once you click on that, you'll see a list of other videos, additional information related to the current topic, free lessons, and lots more.
YouTube no longer sends out email notifications when new videos are posted like they used to do. But if you'd like to get an email every time I post a new video, click on the link to join my mailing list. You can pick how frequently to get emails from me - either as they happen, daily, weekly, or monthly.
If you'd like to become a paid member of my channel and receive all kinds of awesome perks, click on the Join button. You'll see a list of all the different membership levels that are available, each with its own special perks, including my extended cut videos, access to my Code Vault (lots of VBA source code in there), template downloads, and lots more. I'll talk more about these perks at the end of the video.
Even if you don't want to commit to becoming a paid member and you'd like to help support my work, please feel free to click on the Tip Jar link. Your patronage is greatly appreciated and will help keep these free videos coming. I have some puppies to feed.
But don't worry. No matter what, these free TechHelp videos are going to keep coming. As long as you keep watching them, I'll keep making more, and they'll always be free.
If you really want to learn Access and you haven't tried my free Access Level One course, check it out now. It covers all the basics of Microsoft Access including building forms, queries, reports, and more. It's over four hours long. You can find it on my website or my YouTube channel. I'll put a link down below. Did I mention it's completely free? The whole thing. Free. Four hours. Go watch it.
A lot of you have told me that you don't have time to sit through a four-hour course, so I now have a quicker Microsoft Access for Beginners video that covers all the basics faster, in about 30 minutes. No, I didn't just put the video on fast forward, but I'll put a link to this down below as well.
If you like Level One, Level Two is just a dollar. That's it, one dollar, and that's another whole 90-minute course. Level Two is also free for paid members of any level, including supporters. If you're a member, go watch Level Two. It's free.
Want to get your question answered in a video just like this one? Visit my TechHelp page and send me your question there. Members get priority, of course.
While I do try to read and respond to all of the comments posted below in the comments section, I only have time to go through them briefly a couple of times a month, and sometimes I get thousands of them. So send me your question here on the TechHelp page and you'll have a better chance of getting it answered.
While you're on my website, be sure to stop by my Access Forum. We've got lots of lively conversations about Microsoft Access and other topics. I have a fantastic group of moderators who help me answer questions. Shout out to Alex, Kevin, Scott, Adam, John, Dan one, and everybody else who helps on the site. I appreciate everything you do. I couldn't do it without you.
Be sure to follow my blog, find me on Twitter, and of course on YouTube. I'm on Facebook too, but I don't like Facebook.
Now let's talk more about those member perks. If you do decide to join as a paid member, there are different levels: Silver, Gold, Platinum, and Diamond.
Silver members and up get access to all of my extended cut TechHelp videos, one free beginner class every month, and some other perks.
Gold members get all the previous perks plus access to download the sample databases that I build in my TechHelp videos, plus access to my Code Vault where I keep tons of different functions and the code that I build in most of the videos. You'll also get higher priority if you submit any TechHelp questions. Answers are never guaranteed, but you do go higher in the list for me to read them. If I like your question, you have a good chance of it being answered. You'll also get one free expert-level class each month after you finish the beginner series.
Platinum members get all the previous perks plus even higher priority for TechHelp questions. You get access to all of my full beginner-level courses for every subject, and I cover lots of different subjects like Word, Excel, VBA, ASP, and lots of different stuff, not just Access. These are the full-length courses found on my website. You get all the beginner ones. In addition, once you finish the expert classes, you get one free developer class per month, so lots of training.
Finally, you can also become a Diamond sponsor. You'll have your name or your company name listed on a sponsors page that will be shown on each video as long as you're a sponsor. You'll get a shout out in the video and a link to your website or product in the text below the video and on my website.
So that's it. Once again, my name is Richard Rost. Thank you for watching this video brought to you by AccessLearningZone.com. I hope you enjoyed it. I hope you learned something today. Live long and prosper, my friends. I'll see you again soon.Quiz Q1. What is the main focus of the video tutorial? A. How to create a report in Microsoft Access B. How to force users to change their passwords at regular intervals in Access C. How to back up Access databases automatically D. How to send email notifications from Access
Q2. According to the video, which field should be added to the user table to keep track of password changes? A. PasswordHistory B. DateChanged C. LastLogin D. IsAdmin
Q3. Why does the instructor suggest adding the DateChanged field to the user table? A. To track which users are active B. To know when users last logged into the system C. To store the date the password was last changed D. To track account creation date
Q4. What is necessary for a user to be forced to change their password upon their first login? A. Set the DateChanged field to today's date by default B. Leave the DateChanged field blank so it is null C. Assign a permanent password D. Add a field indicating first-time user
Q5. What does the instructor recommend if you have never programmed in VBA before? A. Skip this part of the video B. Watch a separate 20-minute VBA introduction video C. Use macros instead of VBA D. Only use queries for user-level security
Q6. What is the main purpose of using the DLookup function in the logon form code? A. To retrieve the user's account status B. To check the user's email address C. To find when the user last changed their password D. To get the user's group membership
Q7. What method does the instructor use to handle cases where the DateChanged field is null? A. Leave the password unchanged B. Throw an error message C. Use NZ to provide a default, very old date D. Force the user to log out
Q8. Why does the instructor copy the logon form to create the password change form? A. It already has similar controls and layout needed for password changes B. To simplify database backups C. To manage user permissions D. To avoid using macros
Q9. Why are there two password input boxes on the password change form? A. To allow entering passwords for two different accounts B. To let the administrator select the user and the password C. For password confirmation to ensure the new password matches D. To store both old and new passwords
Q10. What is the significance of making an ACCDE file, as mentioned in the video? A. It allows users to edit the VBA code easily B. It prevents users from switching to design view and making changes C. It enables export to Excel D. It compresses the database size
Q11. What should a user do if they want to become a member and download the sample databases? A. Subscribe to the YouTube channel B. Become a Gold member on AccessLearningZone.com C. Send an email to the instructor D. Join the Access forum discussion
Q12. What does the instructor suggest doing before watching this developer-level video? A. Watch the introductory video on user-level security B. Go straight to the code C. Practice with Excel first D. Download any Access template
Q13. What Access VBA technique does the instructor rely on to check for a password change requirement? A. DLookup combined with NZ to handle null values B. SQL Pass-Through Query C. Data Macro event D. Append Query
Q14. What is a benefit of forcing users to change their password upon first login with a temporary password? A. It encourages users to set their own secure password immediately B. It limits database access to administrators C. It prevents deletion of records D. It tracks user logins
Q15. What is the instructor's personal opinion on forcing regular password changes? A. It is always necessary for strong security B. It is unnecessary unless there is a known security issue C. It should be done weekly D. It is only needed for admin accounts
Answers: 1-B; 2-B; 3-C; 4-B; 5-B; 6-C; 7-C; 8-A; 9-C; 10-B; 11-B; 12-A; 13-A; 14-A; 15-B
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.Summary Today's TechHelp tutorial from Access Learning Zone is all about user security in Microsoft Access. I'm going to show you how you can require users to change their passwords at regular intervals, such as every 30, 60, or 90 days, based on your organization's needs.
This question came from one of our Platinum members who asked whether it's possible to force users to periodically change their passwords as part of their company's security policy. Of course, it is entirely possible since you control your Access database. You can implement any features you like, including mandatory password changes after a certain number of days. Personally, unless there is a known security breach, I don't see the need to force regular password changes if a password is secure, but companies often require this nonetheless.
Before getting into the details, I recommend that you watch my earlier user-level security tutorial if you haven't already. That video covers the basics of setting up a simple logon form to protect your Access database, which is usually sufficient for most office scenarios. You need to have a basic logon system in place first, so make sure to review that foundation before tackling this project.
This is a developer-level lesson, so we will be using VBA programming. If you're new to VBA, check out my beginner course on VBA first. It's about 20 minutes long and will bring you up to speed so you can follow along with what we're about to do.
For this tutorial, I start with the sample database from the user-level security video. Members can download that file directly. If you're not a member, make sure you watch the video and build it yourself. Once you have the file, open it up and set up your environment.
Once inside, keep in mind that, by default, the database is locked down via the logon form. In previous lessons, I also explained ways to further secure your database, for example by distributing it as an ACCDE file, which prevents users from entering design view easily.
To implement the password expiration feature, you'll need to track the last time each user changed their password. Go into the user table and add a new field named DateChanged. This field will store the date when the user last changed their password. Leave the default value blank. When checking for expiration, if this field is null (i.e., they've never changed the password) or if the date is older than the selected threshold (30 days, for instance), you'll require them to update it.
Next, you'll need a form for users to change their password. Create a simple form with two password input boxes, ensuring the user enters the new password twice to confirm it. Copy your existing logon form as a starting point and modify it for the password change process. Adjust form and control names appropriately—for example, password1 and password2—and set both to use the password input mask so the text is hidden as they type. The form should include a button (labeled something like "Update") that will handle saving the new password once confirmed.
With the form structure ready, the next task is updating your logon process so that, upon successful login, the database checks if the user's password has expired. Open up the VBA code behind your logon form. After you'll have verified the user's credentials, the system will retrieve the DateChanged value for that user from your user table using DLookup. This value could be null if the user has never changed their password, in which case you'll want to force them to update it now.
If DateChanged is missing or more than 30 days ago, present the user with the password change form and require them to choose a new password. This is also helpful for first-time logins with temporary passwords.
I use the NZ function in VBA to handle null values so that if DateChanged is blank, a very old date is assumed, thus ensuring that the password change will be required. If you're not familiar with using NZ or DLookup, I have separate lessons on those functions that you can find on my website or YouTube channel.
That wraps up the first part of this lesson. I encourage you to check my site or channel for the next video as we continue building out this user security feature.
If you found this tutorial helpful, I appreciate your support and feedback. Be sure to subscribe to my channel for more free Access lessons. You can also join my mailing list to get notified whenever I publish a new video, and you can choose how often you want to receive those notifications.
For those who wish to further support the work I do, feel free to use the Tip Jar feature on my website. If you'd like even more perks, joining as a paid member gets you access to extended videos, downloadable sample databases, my Code Vault with various VBA routines, and much more depending on your membership level. Each tier—Silver, Gold, and Platinum—offers increasing benefits, including priority for TechHelp questions, more free training, and additional exclusive content.
If you really want to master Microsoft Access, make sure to try my free four-hour Access Level One course. It covers the basic skills you need to get started, from designing forms to running queries and building reports. For those in a hurry, I also created a fast-track introductory video. Level Two is available for just a dollar or completely free for all paid members.
To get your own question answered in a future video, visit the TechHelp page on my website. While I do read and respond to as many comments as I can, I get thousands of them every month, so submitting your question via the website gives you a better chance of getting a prompt response.
While you're visiting my site, feel free to check out the Access Forum. It's a helpful community with lively discussions and support from moderators and members alike.
You can also follow my updates on my blog, on Twitter, and of course on YouTube. I am present on Facebook as well, though it's not my favorite platform.
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 List Creating a DateChanged field in user table
Determining when a password was last changed
Adding password change tracking to the user table
Creating a password change form with two password fields
Setting input masks for password fields on a form
Copying and modifying an existing logon form for password changes
Updating event procedures to enforce password change intervals
Using DLookup and NZ functions to retrieve DateChanged values
Checking if password change is required during login
Forcing users to change their password on first login or after interval
|