User activity (1 Viewer)

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
Hi everyone,

I would like to know if VBA is able to track user activity on the computer?
Things like Idle time (similar to "away" or "Idle" in MSN), or to know if outlook, excel or word is open on their computer.

If so, how do you do it?
 

ByteMyzer

AWF VIP
Local time
Today, 14:24
Joined
May 3, 2004
Messages
1,409
There are different ways that this can be accomplished, but each method has a different application. For what purpose do you wish to do this? What is the application?
 

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
I intend to create using VBA in MS Access 2003. I am ask to created it to find out the time taken for a job to be taken, amount of idle time on the computer (user leaving the desk for extended lunch break), to find out if outlook is open so that I can launch my email function in access.

Stuff like that, is it possible?
 

ByteMyzer

AWF VIP
Local time
Today, 14:24
Joined
May 3, 2004
Messages
1,409
In essense, you are being tasked with creating a spyware tool for your bosses to profile its employees' actual working time?

Microsoft Access is not the tool that you want for this purpose. There are off-the-shelf products that are suited for this task for your employer if they really are that petty.
 

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
hahaha, I guess as much that you will say that. but in our nature of business, it is not spyware.

It is like taxation, we need to bill our customer by the number of hours we work on the project. The problem is that the number of hours works for certain products are not finalised yet and we are doing this for a few months to find out the average working time per product per user. If all of my users knows that we are using this tool, I do not think is call spyware right?

As for idle time, it is for kicking user out of my database and email function; is for email. I already am using these two function by the recommendations posted in here but I am trying to advance my skill by learning alternatives.
 

ByteMyzer

AWF VIP
Local time
Today, 14:24
Joined
May 3, 2004
Messages
1,409
Nishikawa said:
It is like taxation, we need to bill our customer by the number of hours we work on the project. The problem is that the number of hours works for certain products are not finalised yet and we are doing this for a few months to find out the average working time per product per user. If all of my users knows that we are using this tool, I do not think is call spyware right?

As for idle time, it is for kicking user out of my database and email function; is for email. I already am using these two function by the recommendations posted in here but I am trying to advance my skill by learning alternatives.
This is more like the answer I was looking for, the specific application for which such a program would be required. Now it makes sense.

It is possible to program a timeout feature within your database program. It is also possible to program Access to work with your Email. For a program which monitors the usage of OTHER programs, however, again, Microsoft Access is not the tool you want to use.
 

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
So how does the timeout feature works? Keying in data into my database or mouse movement? key stroke? I am having problem with my users running off for meeting without closing my database!!
 

ByteMyzer

AWF VIP
Local time
Today, 14:24
Joined
May 3, 2004
Messages
1,409
I've attached a sample database (Access 2000 format) that uses Windows Message hooks to capture keyboard/mouse activity to the database. Opening the database will open a form in which the User can type some miscellaneous text, but if the computer remains idle (no keyboard or mouse activity) or if the Windows has the focus on another application, the database will close and Access will exit after ten seconds.

You can use different timeout values by simply changing the value of the timeout constant in this line of the mdlTimer Module:
Code:
Private Const lTimerMax As Long = 10
 

Attachments

  • dbTimer.zip
    13.1 KB · Views: 399

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
WOW!!! Thanks!!! I was also reading other forums, some of them us the getlastinfo function from user32.dll. What is the difference?
 

ByteMyzer

AWF VIP
Local time
Today, 14:24
Joined
May 3, 2004
Messages
1,409
The most important difference is, prior to Windows 2000, the GetLastInputInfo function was not available in user32.dll. The solution I provided should work with Windows 95/98 as well.
 

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
if I want to detect idle time not only for access but system idle time, can I use getlastinputinfo function in access 2000/2003?
 

Nishikawa

Registered User.
Local time
Today, 14:24
Joined
May 17, 2007
Messages
97
the reason why I think system idle time will be more applicable to me is that if user left the office for lunch and comes back, my team lead will be able to know it as ms access will change his status to green. (all messaging system in banned in my office)
 

Users who are viewing this thread

Top Bottom