A clever workaround for legacy environments, though it ultimately highlights the architectural limitations of using Microsoft Access for modern session management.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Are You There? Automatically Log Users Out After Inactivity in Microsoft Access, Part 3Added:
Welcome to another tech help video brought to you by accesslearningzone.com.
I'm your instructor Richard Rost.
This is part three of my are you there series where we're logging off users if they walk away from the computer for more than an hour or whatever.
If you haven't watched parts one and two yet, go watch those first and then come on back.
All righty, so we've got a pretty good system working.
It's updating this guy's timer event and resetting it to an hour every time we have some kind of a status update, right? And you can throw status updates all over your database, but your users might still find a spot where you didn't.
They might be opening up like a customer form, just moving around between different things here. You can put it in the on current event like I said before, but you know, that's sometimes not always good enough.
So, what we can do is we can also check, track, and store where they are in the database, what form they're on, and what control they're in.
And we can do that with screen.activeform and screen.activecontrol, and we can save those in a couple of temp vars.
And I know temp vars was a prerequisite for the message box timer video, so if you haven't watched that yet, go watch my temp vars video.
But, let's go to the status function where a lot of the work for this is being done.
Here's status right here.
Now, remember I said we're going to add some stuff here. Whenever status is invoked, we're going to just keep track of where the user was at that moment.
Okay, cuz this is going to run often, so this will at least be one more check, right? So, we're going to say temp vars and uh it'll be are you there active form equals screen.activeform.
Now, you can't just say screen.activeform cuz screen.activeform is actually a form. And if you do just this, Access will yell at you. I don't know if it's a compile error or if it's going to be a runtime. It'll be a runtime error, trust me. I've run into this a million times because it'll say you can't assign an object to a temp var.
It only handles It only holds basic variable types like strings and stuff.
So, we have to send dot name.
Okay? That's just something you got to do.
All right? And we'll do the same thing with the active control so we know what form and control they're on. All right?
Active control.
And active control.name. That should This is just one way to do it. All right? So, we're updating that temp var every time the status is invoked. Okay?
Now, another thing we'll do is where we're actually checking that form timer, this guy, design view, in his timer event, okay?
Before we even get to this message box timer thing, we're going to check the active control and the active form. And if those don't match what we saved in the temp vars, then we can say that we've already we we've also detected some user activity and we're not going to and we're going to reset the timer.
All right? So, check active form and control up here.
And we probably should have put a note down here, too, right? Uh pop up message box with timer to ask if user is there.
Okay, but before we even get to that, we're going to check to see if the form and control are different. Now, these are set by the status function, which is the first thing running in the database. So, they shouldn't be null. If you want to add checks here to make sure they're not null, you can do that as well. I'm not going to do that cuz I know that status sets them already.
And basically, all we have to do here is kind of what we did below. We'll just say, "Okay, if the active form is different or the active control is different, then status activity detected, and the timer will reset, and it'll just go back to another hour. So, we can say if temp vars are you there active form is not the same as screen.active control.name, or Uh da da da da da da. What did I miss?
Temp vars is not the same as screen.active control.name, or Oh, the line continuation, right? Uh we can copy all this and just change it to control.
Right? Screen.active control is different, and this should be form.
I'm losing it today, people.
Okay. If the temp vars for active form is not the same as the active form's name, or the temp vars for the active control is not the same as the control's name, then status um user activity movement detected, timer reset, or whatever you want to put there.
And then exits up. In other words, it'll never get down to this down here.
Right? You won't even see the pop up as long as the system detects that they've moved, they've changed forms, or they've changed controls within the same form.
Okay?
And that's the case, then we don't got to worry about it resetting.
All right, debug compile.
All right, we're good.
Let's close this and reopen it. Save changes? Yes. All right, open her up.
Okay. Now, I'm going to open up the customer form over here.
All right, now, moving from control to control normally wouldn't be enough to keep this guy alive.
Because notice there's nothing happening in the status there. But, I'm going to turn on that cheat for 5 seconds. Let's see what happens.
All right. Cheat's on, 5 seconds. I'm not going to do anything, and I should get my pop-up.
Okay, user activity movement detected.
It'd probably because I'm I changed to this control cuz I clicked the button.
Let's see what happens now.
Oh, it reset. We got to click it again.
Okay, because remember before I was up in the form and then I clicked the button.
So, the button click actually changed it. There, now it's running. Are you still there? Yes, I'm still here.
Okay, that went back to an hour. Now, here's what I'm going to do. I'm going to turn this on, but I'm just going to keep moving between these fields, and it should detect that as movement. Ready?
Click, it's on. I'm just going to move between these different fields.
All right, I moved down to here. Okay, user activity movement detected, and it reset to 1 hour again.
So, I'll do it again. Actually, we need a better way to test this.
I'm going to temporarily make the status box reset to 5 seconds as well. Don't forget to put this back though. So, we're going to we're going to pause this.
We're going to have it so it's every 5 seconds regardless. All right, so we'll do we'll do 5,000.
Okay.
All right, now I'm going to do that. That's going to reset at the 5 seconds. Let's test.
Okay, yeah, are you there? I'm still here. Okay, I'm going to go over here and now I'm going to move to a different field. Let's see if it detects the movement.
All right, it detected it. I'm going to move over here now.
It detected it. I'm going to move up here.
It still detects it. Okay, that's good.
If I stay here and don't move, All right, that's it. Yeah, yeah. Okay, all right, we're good. Let's turn that off now. Let's go back and put it back to an hour.
I'm just going to do that and that.
And we'll do uh 5 seconds for testing, so you can have that in there as well.
Okay?
All right. So, now we've got two pretty good methods for detecting that the user is still in the database. Still doing stuff.
>> [snorts] >> Okay? Is it perfect? No, but it's it's pretty good. All right. Those two things alone, between status and changing forms and controls, um that's good enough. Now, there could be another situation where uh the user is like, you know, let's let's say that this customer form has a really big note field on it and they're using that as um you know, they're they're writing up, you know, a long something. They're writing an article. I have a database where I do a lot of writing in like my captain's log. It's in an Access database. I do all my writing in that. I got my formatting and stuff, buttons and all that. And then when I'm done, I hit publish and it just sends it up to my website database.
Um but I could very easily be working in that single text box for maybe not an hour. Usually doesn't take me an hour to write a captain's log. But I could see someone else, you know, couple hours, they're still working in that same field. They haven't hit save in a while.
All right. So, we'll deal with that in the extended cut.
All right. So, in the extended cut, for the members, we're going to make this system much smarter and a lot more polished. I'll show you how to detect if the user is typing or moving the mouse in any form, anywhere.
Even if they stay on the same form and in the same field the whole time.
This is good for those big long notes fields, right? Like you type a novel into.
Um we'll add some sound effects. I got some really cool Star Trek sound effects that I use, but you could I'll show you where you can find some some sound effects online.
Um we'll add some speech. Have the computer say, "Hey, you still there, dummy?" No, we won't make it say dummy.
We can make it say whatever you want.
Um we'll also build multiple warning stages with like a red alert klaxon going off in the background. Like give them 60 seconds that's calm and quiet.
And then, you know, "Hey, you still there?" And then 10 more seconds until it really goes bye-bye.
>> [snorts] >> Um so, if you want a more robust and professional auto logoff system, that's all covered in the extended cut. Silver members and up get access to all of my extended cut videos, all of them.
There's lots of them. There's hundreds of them by now. Tons and tons of stuff to watch. Gold members, as you've seen, can download the databases that I build in the tech help videos.
Um all of my members get some free training. And it's a big fun party on my website. So, join and I'll tell you where the party's at.
>> [laughter] >> But, that is going to do it for your tech help video for today and for this series.
Post a comment down below. Let me know if you're going to use this stuff, what you liked, what you didn't like, if you have any questions, or what you'd like to see in a future video.
That's going to do it for your tech help video for today. I hope you learned something. Live long and prosper, my friends. I'll see you next time.
If you enjoyed this video, hit that thumbs up button right now and give me a like.
Also, be sure to subscribe to my channel, which is completely free, and make sure you click that bell icon and select all to receive notifications whenever I post a new video.
If you're new to Microsoft Access, check out my Access beginner level one course.
It's over 4 hours long and it covers all the basics like tables, queries, forms, and reports.
It's a great place to start, and it's also completely free.
Members of my channel get extended cut videos, sample databases, access to my code vault, and full training classes every month. Click the join button for details.
Thanks for watching. I'm Richard Rost with accesslearningzone.com.
Live long and prosper, my friends. I'll see you next time.
>> Mhm.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 viewsβ’2026-05-28
How agent o11y differs from traditional o11y β Phil Hetzel, Braintrust
aiDotEngineer
450 viewsβ’2026-05-28
Re: π£οΈπthepropheduπ2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 viewsβ’2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanationπ―β
LearnwithSahera
1K viewsβ’2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 viewsβ’2026-05-29
Search Algorithms Explained in 60 Seconds! π€π¨
samarthtuliofficial
218 viewsβ’2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 viewsβ’2026-05-30
Instagram accounts got PWNed
EricParker
13K viewsβ’2026-06-03











