I make front ends for each of my users (some of them read-only; others displaying only a subset of the data), but many of my users are pretty unsophisticated. This results in their leaving their computers on when they leave work for the day and, consequently, leaving their database open. That, of course, prevents me from working on the database's back end.
I'd prefer it if I could insert a timer that closes the front end after 15 minutes of inactivity. Failing that, does anyone know of a way to remotely kill a front end?
14 12889
To the best of my knowledge, there is no built-in functionality within Access that monitors inactivity. You may be able to accomplish this by the API, but I'm not exactly sure how to go about this.
NeoPa 32,556
Expert Mod 16PB
As long as any form is still open the timer facility can be made available to run code after a certain period of inactivity. Inactivity would have to be defined in the code though, as I don't believe Access provides anything built-in. It would mean every action within the project would have to log activity when it executed, thereby resetting any timer. Quite complicated, and prone to error unless you make sure that every possible form of detectable activity is logged.
Okay, then, is there a way for me to remotely kill a front end? I know that after a certain time in the evening everyone is actually off.
The following Code comes with no Implied Warranty whatsoever, theoretically it should work. - Set the Form's Timer Interval to 900000 (15 minutes), or whatever Value you like.
- Place the following Code in your Form's Timer() Event, I'm assuming your Form's Name is Form1.
- Private Sub Form_Timer()
-
If Time > #11:00:00 PM# Then
-
DoCmd.Close acForm, "Form1", acSaveNo
-
DoCmd.Quit
-
End If
-
End Sub
- Every 15 Minutes, the Timer() Event will fire and see if the Current Time is after 11:00 PM (Date is irrelevant, Time can be changed).
- If it is after 11:00 PM, and as long as the Database is active, and Form1 is open, the code will then:
- Close Form1, disregarding the Save to avoid any Prompt.
- Quit Access.
- This Procedure must be duplicated on each and every Front End.
- Good Luck, and let me know how it works out.
I actually have an application that uses Colintis link. It works fine.
In another application, I also have a system table that contains two fields, param and value. One of the entry has param "IsBlocked" and the value can be either no or yes, which I can change at will. If I set it to yes, people will be kicked out of the application as soon as they perform selected operations like scrolling data or changing certain fields. If set to yes, it will also prevent people from starting the application.
These are great suggestions. Thanks, all! I think I'm going to first try the idle time code as published on Microsoft's website; it seems the most flexible.
I'll post back to this thread once I've figured out which approach worked best for me.
NeoPa 32,556
Expert Mod 16PB
I don't believe there is an Access way to kill a front-end. I expect there are ways to kill processes remotely if you have the process ID, as there are tools out there that do that, but I'm afraid I have no idea how that would be implemented programatically.
ADezii's approach of checking the time of day, may prove more productive for you considering what you've told us. In such a case, the period between checks is not limited to 15 minutes of course. Every minute would be just as appropriate (possibly more so).
NeoPa 32,556
Expert Mod 16PB
On first reading that I felt the concept was a little clumsy, but looking at it again, it's hard to see what type of database activity could go on if the current form and control remained the same at every check (each second) for a duration of 15 minutes.
That's quite a neat solution. Possibly not 100%, but pretty darn close. You'd probably need to ensure users only ever accessed the database via the programmed interface, but many like to ensure that anyway, so not much of a cost.
I actually downloaded the Microsoft Demo and found it to very interesting and related to this Thread. I made some slight changes of my own, prettied it up a little, and created my own Demo which I hope will clearly demonstrate the technique of closing Front End DBs after a certain period of inactivity, solely within Access. Download the Attachment and see what you think.
Wow, thanks, ADezii! My work schedule this week probably means that I won't be able to actually try this out until at least the weekend, but you can be sure that I'll report back as quickly as possible.
Thanks again!
You are quite welcome, sueb.
Okay, this is yet another triumph! The combination of the MS stuff in the link posted by colintis and ADezii's timer are perfect--I inserted ADezii's timer bracket around the whole thing.
So how do I choose two "best" answers? Because, really, the time-of-day thing is particularly important...
colintis was the first to propose a workable solution, I do believe that you should select his as the Best Answer.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: news.terra.es |
last post by:
Hi all,
I cannot manage an Access short time date format from python ODBC.
How could I do?
Here it is an example of what I do.
>>> import odbc
>>> cnn = odbc.odbc("DATETEST")
>>> cur =...
|
by: Peter Moscatt |
last post by:
Does Tkinter provide a combobox or do I have to find some way of making a
listbox do the job ?
Pete
|
by: Sebastian C. |
last post by:
Hello everyone
I just found at the adress below Microsoft Access Run Time. It says
that this is Access Run Time :Alternative Version.
There is nothing about who can download or install this...
|
by: Jacquo Johnson |
last post by:
I am receiving the following error:
MS Access Date/Time DBD::ODBC::st execute failed: , , " .
"FROM WHERE > '2004/02/01
11:16:16'";
$sth = $dbh->prepare($sqlstatement);
$sth->execute ||...
|
by: tombsy |
last post by:
Please can you tell me what version of DAO does access 2002/2003 use ?
Access 97/2000 can use DAO3.5 and DAO3.6
Can I compact a 2002/2003 db using DAO 3.6?
thanks in advance
regs Tombsy
|
by: cyshao |
last post by:
When we copy files in MyComputer, there is a dialog with a ProcessBar and a
Cancel button.
Does C# provide something like this dialog?
Thanks
CYShao
|
by: nd02tsk |
last post by:
Hello
Does PostgreSQL provide anything comparable with the functionality of
MySQL Cluster?
I appreciate all information.
Thank you.
Tim
|
by: ReshmaPC |
last post by:
Hello all,
How to access real time data that is in remote server to local data base..
Regards
Reshma
|
by: Paul H |
last post by:
Most of my projects are developed in Access 2003. I have not even installed
Office 2007 yet!
I need to buy VSTO to get the run-time licence for Access 2003. No doubt I
will soon need a run-time...
|
by: muddasirmunir |
last post by:
well i want to know how to install microsoft access run time component in user machine
so the user did not have to buy microsoft access.
actullay, i want to know that while insatalling our...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |