How to Program Access to Close Automatically when No Activity

  Рет қаралды 27,736

T Golden Eye

T Golden Eye

Күн бұрын

Make Access Program to Close Automatically when there is no activity by a set minutes.

Пікірлер: 46
@Jim-nu6ux
@Jim-nu6ux 2 жыл бұрын
This works great. Just what I needed for a work database where the guys leave the database open when they go home and I can't work on it unless I unplug their computer. Thank you very much. Well worth a follow.
@zuesking1974
@zuesking1974 6 жыл бұрын
Thanks. This works great! I change the code to run in seconds rather than minutes and set the timer to 300 seconds to close after 5 minutes to close.
@michaelmascari9785
@michaelmascari9785 4 жыл бұрын
Fantastic! Clear and effective instructions. Thank you so much!!
@MichaelTrezor
@MichaelTrezor Жыл бұрын
Amazing video!!! Thank you very much. You have saved my life 🥳🥳🥳
@franksmit4914
@franksmit4914 11 ай бұрын
Works well, thank you !!!
@mahmoodsheikh4046
@mahmoodsheikh4046 4 жыл бұрын
U r really great teacher 😍
@sbaud2003
@sbaud2003 6 жыл бұрын
excellent tutorial thank you sir.......
@Nerosis1916
@Nerosis1916 4 жыл бұрын
This helps alot! Thank you! I do have a question, does this code work for a form with multiple layers? That is a form within a form
@khaldounkahaleh9904
@khaldounkahaleh9904 4 жыл бұрын
great explanation, code works in good mode, i had added some features, allowed user to cancel or resume the countdown
@nealrayce
@nealrayce 7 жыл бұрын
This is exactly what i was looking for thank you!!!!!!!!
@obbc9747
@obbc9747 Жыл бұрын
Thanks, great explanation
@vbaaccess1365
@vbaaccess1365 8 жыл бұрын
Absolutely brilliant! Thanks a lot for video.
@ShrutitPatel
@ShrutitPatel 5 жыл бұрын
Saved life! Thank you so so much.
@rufi4you
@rufi4you 8 жыл бұрын
@Austin, I have implemented this feature in my DB But this feature only works if if my DB is active in the foreground In other words, is my DB minimized or I work in another e.g. Word or Excel windows this feature do not working. My users work with other tools and because it would be nice if it then especially the DB closes. Sorry everything else does not make sense. @Austin, do you have to a solution for this? Thanks
@JWEERASINGHE
@JWEERASINGHE 4 жыл бұрын
Thank you very much,
@DanWalters87
@DanWalters87 3 жыл бұрын
I have used your code however i cant see what i've done different. my code is exactly the same as yours however when I view the form the counter doesn't start and nothing happens. Timer interval set to 1000 and on timer set to event with the code. are there any behind the scenes settings or references need to be checked?
@suzukyotoltd8143
@suzukyotoltd8143 11 ай бұрын
same for me, counter never starts, did you get any solution?
@jungjungdelosreyes4147
@jungjungdelosreyes4147 2 жыл бұрын
Hi sir can you please help to include also when open report still it will quit. Thank you sir Teawan. Appreciate a lot on this wonderful video.
@scottaxton2513
@scottaxton2513 8 жыл бұрын
Tewan - Excellent video and concepts. I found your videos only a couple weeks ago and have learned a lot so far! My database is split into front-end/back-end. I'm assuming this would need to be in the front-end files. Is that correct? If that is so my Idea might not work - maybe you have another suggestion for this thought: Could this same type of function be used from an "admin" tool to force all users off the database? My thought would be to put a value in a table and have it look at that value. If the value for [status] = Normal no action to be taken - if the value for [status] = Shutdown then log off all users so maintenance could be performed. Table updates, Backup, anything requiring exclusive mode. You could even broadcast a message box telling them the database is being shut down in 15 Minutes etc..... You have provided me inspiration to try some things!! Thanks - Scott
@austin72406
@austin72406 8 жыл бұрын
yes, Scott. you can set up like you said.
@arianmarshal1
@arianmarshal1 6 жыл бұрын
Hi Austin, Thanks for the video, It works great on the Backend version, However when I publish it in a .accde format it does not work? Do you know how I can fix it or perhaps have a video for the front end as well? Many Thanks
@SuryaHartono84
@SuryaHartono84 4 жыл бұрын
Very nice tutorial. Can you please help me if there is no ActiveForm selected, just like when click outside the form or click outside of the application, I want the timer is also ticking.
@tglock19
@tglock19 18 күн бұрын
currently when I run my program and i move the mouse, it doesn't reset then time, but closes in the same amount of minutes
@johargamer101
@johargamer101 3 жыл бұрын
Beauty speaking thanks
@29884840
@29884840 7 жыл бұрын
Thanks a lot sir.
@hamidabbasi3856
@hamidabbasi3856 2 жыл бұрын
great video BUT BE CAREFUL IF YOU HAVE ANY MACRO THAT FOCUS YOU ON AN ELEMENT - that macro will not work because every second the internal focus of system is diverted per this subroutine , I have a seach m,acro that goes to a field and give you a windows for search where you can type in what you are looking for and it stopped workign until I cahnged the time interwal to 60 000 ( 1 minutes) so my macro has one minutes to look for the field
@nandkishore9014
@nandkishore9014 4 жыл бұрын
Excellent
@farinatty
@farinatty 6 жыл бұрын
Would using option explicit at the start of the code have caught that expiredminute vs expired minutes error??
@brianklanjscek8154
@brianklanjscek8154 5 жыл бұрын
Question, This works perfectly, the only issue I have today is if anyone has a Report open the timer never starts. How can I fix that?
@donnahamby1557
@donnahamby1557 5 жыл бұрын
Hi Brian, I am having this same issue with a report being left open. Were you able to fix this? If so could you help me with this?
@jungjungdelosreyes4147
@jungjungdelosreyes4147 2 жыл бұрын
@@donnahamby1557 me too hope sir Tewan can help us. 🤗
@osamabatrikhi5272
@osamabatrikhi5272 4 жыл бұрын
Thanks indeed
@vincenzocompagnone2636
@vincenzocompagnone2636 4 жыл бұрын
Thanks
@paul528i
@paul528i 3 жыл бұрын
when run, shows error message The expression On Timer you entered as the event property setting produced the following error: Sub o Function not defined This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.
@mulla916
@mulla916 8 жыл бұрын
yet another useful video... could you plz help me creating a module for datediff excluding only the holidays table... currently i have a module which excluded sunday an saturday which i do not want... i want to exclude only holiday table dates... thanks
@austin72406
@austin72406 8 жыл бұрын
I have another video at kzbin.info/www/bejne/hJKXnJ2oZ6qcgsk it will count only the working day that exclude the holiday and weekend. there is a code for excluding the holiday. you may modify a little bit from this video.
@mulla916
@mulla916 8 жыл бұрын
+austin72406 Thank you for your response, Unfortunately I am not good at vba... I have below code and my weekend is only Friday.. can you please help me with where I am going wrong.. I want only Fridays to be excluded,, plz helpPublic Function Weekdays(ByRef startDate As Date, _ ByRef endDate As Date _ ) As Integer ' Returns the number of weekdays in the period from startDate ' to endDate inclusive. Returns -1 if an error occurs. ' If your weekend days do not include Saturday and Sunday and ' do not total two per week in number, this function will ' require modification. On Error GoTo Weekdays_Error ' The number of weekend days per week. Const ncNumberOfWeekendDays As Integer = 1 ' The number of days inclusive. Dim varDays As Variant ' The number of weekend days. Dim varWeekendDays As Variant ' Temporary storage for datetime. Dim dtmX As Date ' If the end date is earlier, swap the dates. If endDate < startDate Then dtmX = startDate startDate = endDate endDate = dtmX End If ' Calculate the number of days inclusive (+ 1 is to add back startDate). varDays = DateDiff(Interval:="d", _ date1:=startDate, _ date2:=endDate) + 1 ' Calculate the number of weekend days. varWeekendDays = (DateDiff(Interval:="ww", _ date1:=startDate, _ date2:=endDate) _ * ncNumberOfWeekendDays) _ + IIf(DatePart(Interval:="w", _ Date:=startDate) = vbFriday, 1, 0) _ + IIf(DatePart(Interval:="w", _ Date:=startDate) = vbThursday, 1, 0) _ ' Calculate the number of weekdays. Weekdays = (varDays - varWeekendDays) Weekdays_Exit: Exit Function Weekdays_Error: Weekdays = -1 MsgBox "Error " & Err.Number & ": " & Err.Description, _ vbCritical, "Weekdays" Resume Weekdays_Exit End Function
@austin72406
@austin72406 8 жыл бұрын
VBA has weekday built-in function for you. you can just modify a little bit like mine: Public Function NewWeekdays(startDate As Date, strEndDate As Date) As Integer Dim intCount As Integer Dim strMydate As Date On Error GoTo errHandler intCount = 0 strMydate = startDate - 1 Do While strMydate < strEndDate strMydate = strMydate + 1 If Weekday(strMydate, vbMonday) < 6 Then intCount = intCount + 1 End If Loop NewWeekdays = intCount errHandler: Exit Function End Function then just call it and put the number of weekdays on the text box text6 Me.Text6 = NewWeekdays(Me.Text1, Me.Text3)
@dmor3359
@dmor3359 5 жыл бұрын
I have successfully placed this code in my dbase. However, when I use the msg box code the dbase stays open until someone presses the OK button on the message box. Can it have another timer for the msg box to displaythe message box for only 1 minute and then close without having to click ok on the displayed message box? Initial close time is set to 20 minutes and works fine without the msgbox.
@tonyjohnson4351
@tonyjohnson4351 4 жыл бұрын
I believe message box requires user input. Your best bet is a popup box. Add this to your code where you want to quit: Dim WshShell As Variant Dim y As Integer Set WshShell = CreateObject("WScript.Shell") y = WshShell.PopUp("The Database is going to close due to inactivity" & vbCrLf & vbCrLf & "Closing in.....", 1, "Good Bye") Set WshShell = Nothing
@brianklanjscek8154
@brianklanjscek8154 5 жыл бұрын
@Nana Sara
@abdoviper
@abdoviper 4 жыл бұрын
autoexec not running when saved as accde
How to Generate Email List from MS Excel
27:16
T Golden Eye
Рет қаралды 2,9 М.
How to set Access database expired
19:58
T Golden Eye
Рет қаралды 16 М.
나랑 아빠가 아이스크림 먹을 때
00:15
진영민yeongmin
Рет қаралды 17 МЛН
The FASTEST way to PASS SNACKS! #shorts #mingweirocks
00:36
mingweirocks
Рет қаралды 15 МЛН
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 99 МЛН
How To Log User Activity In Access 2013 🎓
27:13
Programming Made EZ
Рет қаралды 118 М.
how to run Access form Automatically as Full Screen | Very Simple Methods.
9:47
Jamal Programming Tips
Рет қаралды 29 М.
How To Use A Timer To Run A Command In Microsoft Access 2013 (Automated Tasks)
29:13
Microsoft Access Multi-Field Search Form
10:30
Computer Learning Zone
Рет қаралды 624 М.
59. Securing Your Front End (Programming In Microsoft Access 2013) 🎓
16:55
Programming Made EZ
Рет қаралды 220 М.
MS Access: Create Auto-Backup V2 Part 1 in Access
25:23
T Golden Eye
Рет қаралды 7 М.
STORE INVENTORY POS IN MS ACCESS VBA (WITH SOURCE CODE)
22:17
SHABBY TV VBA SOURCE CODES
Рет қаралды 13 М.
How To Manage User Authorization and User Access in Access 2013 🎓
38:06
Programming Made EZ
Рет қаралды 256 М.
나랑 아빠가 아이스크림 먹을 때
00:15
진영민yeongmin
Рет қаралды 17 МЛН