Moxie Drive Expressions Article Directory


MS Access Tip: Keeping up with user Activity...

At times you will find it very handy to know what a user was doing in your application at a specific time. This is especially useful with multi-user database applications for debugging or security reasons. With this tool implemented in your applications you will be able to see what event happened and at what time.

Here's the tip:

You are going to use a table and this simple set of code to record all the users transactions that you want to track. There are three simple steps to set this up in any application you develop. Create a table to hold the data, create a quick module, then add two lines of code to each operation you want to track such as a Form_Open or Form_Close event. That's it and you will find the information very useful.

Follow these simple steps and you will have a history of activity in your applications. Step one and two only have to be done once. Step 3 is needed for every event you want to track.

First create a simple table as described below:

1] Create a table to hold the user log information and name it USysLog.
Add these fields

Event as Text
EvTime as date/time

Save the table and name it USysLog and click No when asked to create a Key field

2] Create a module and add the following code. You can just cut and paste the following lines into a new module and save it using any name like LogMod.

'cut here
'Dimension a public variable at the top of the module.
Public LogEvent As String

'Next add this code in the module
Public LogEvent As String

Public Function LogEvt()
Dim SQL As String
SQL = "INSERT INTO UsysLog ( Event, EvTime ) SELECT '" & LogEvent & "' AS x1, #" & Now() & "# as x2;"
DoCmd.RunSQL SQL
End Function
'cut here

Close the module and save it as LogMod. (Name not important)

3] Next add these two lines of code to each event that you want to record a time for and edit the first line for the appropriate form name and event. In this example, you would see the text "Logon Opened" and an associated time in the UsysLog table.

LogEvent = " Logon Opened "
LogEvt

If you want to log a form opened time then put these lines in the "Form_Open" event and likewise if you want to log the form close time put it in the "Form_Closed" event and edit the wording on the first line accordingly. This way you will have a time stamp of the event in the UsysLog table with your own wording.

With multi-user databases we usually take it a step further and capture the user name with a login screen or the computer name (which can be done automatically) and drop that in the table as well so you know exactly who did the operation as well.

Please take a look at http://www.accesshelpebook.com/ and see if you can't take advantage of all of the examples found in our Access Help Ebook to help you make your databases more robust.

Our Office Automation Services include solutions used by both large and small companies that are affordable and easy to use. Our products and services are proven to enable our customers to provide better service to their customers while saving them money in the process. Our customers find that their return on investment is most often realized after using their applications just a few times.

What could BioMation Systems do for you?

Go ahead, take another look.



Category: Software

MS Access Tip: Keeping up with user Activity was written by:

Author:Jon Watson
Added: Sat, 20 Oct 2007 07:40:24 -0400
This Article Has Been Read 700 times

View all Jon Watson's articles

About the Author: Jon Watson is the founder of Biomation Systems, Inc. With 26 years experience helping Fortune 500 companies with process improvement he formed BioMation to bring the same expertise to smaller companies that need the same improvements at an affordable price.
Website: http://www.biomationsystems.com

More Articles About Software

Popular Articles

Access DatabaseTip: Create a user defined search field for a list box
Guidelines to Making a Successful Presentation
MS Access Quick Cash Flow Calculator tip
The best open source scripts on php/mysql
Working from the beach: remote office in a nutshell
Most Popular Electronic Medical Billing Software
Internet explorer vs. FireFox
Software for Tax Deduction
What Is The Purpose Of ERP Software?
Erasing your Internet Tracks and History
The Most Important Components of HR Software
Software Testing Course: Where Can You Take Them?
Internet Cleaners Tools
Looking For Erp Software?
Quickbooks Premier: A Notch Above the Rest
The Latest News On ERP Software
Digital Rights Management And It's Death
Anti-Spyware and Pro Security
Tools to Protect your Privacy and Security
Human Resources Software
Recent Articles

What Can Microsoft Dynamics GP do for you?
Take care while choosing the Right Ip Camera Software
Make a Career in Embedded Software Engineering
Automatic Calling Software-Making Life Easier for Frequent Callers!
Stunning Powerpoint Presentation 2 Powerful Secrets Revealed
Three Ways to Become an Expert on Presentation
Download Most Popular Software titles online instantly
Microsoft Excel Basics: What Are Functions?
How to Bypass Websense
Softweb Solutions - Global offshore IT solution provider
How Point of sale software will automate your online business
Software Outsourcing
Privacy on the Internet
Web Filtering in the Business Place
Providing for your customer with CRM
The revolutionary software - Astute
STOCK TRADING SOFTWARE PROGRAMS
Information regarding Web Filtering
What is Astute Software?
The Benefits of Web Filtering

Not What You Were Looking For?


Google
Google

Moxie Drive Expressions Article Directory Main Page. Moxie Drive Expressions

Submit Articles Submit Articles

Contact us Contact us

Add to favorites Add us to favorites


Add to Mixx!

Fave it!

Subbmitt!

Hint - Hold "T" button down and right click to open Sphinn and Subbmitt in a new window.



Count



Feeds

Valid HTML 4.01 Transitional