Solved

How to do the event log in Access 97?

Posted on 1997-12-16
5
232 Views
Last Modified: 2012-08-13
Hello!

      I like to know how to provided the event log in Access 97 by using the security provided by Access 97. Is mean that the I not need to create my own password form screen
by weitten coding in module instead to create the event log. have any shortcut to doing .

    Thank you!


sean yeo

0
Comment
Question by:seanyeo
  • 3
5 Comments
 
LVL 12

Expert Comment

by:Trygve
ID: 1962813
Could you please refrase the question.

Do you want to log the users activity or do you want to do user administration ?
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1962814
In VBA 5.0, there are two new methods on the app object, .startlogging and .logevent that allow you to place items in the system (or if 95, your own) event log.
0
 
LVL 12

Expert Comment

by:Trygve
ID: 1962815
No such thing as .startlogging and .logevent in Access 97 as far as I know.
0
 

Author Comment

by:seanyeo
ID: 1962816
Beside the VB5.0 Method, have anyway to do it in Access 95.
0
 
LVL 12

Accepted Solution

by:
Trygve earned 60 total points
ID: 1962817
If you want to keep track of the user activity: which forms they open, reports preview/printed macros executed etc. the best thing to do is to make an EventLog table. Something like this might do the trick:

Login     ' UserID
DateTime  '  
EventType ' OpenReport, OpenForm etc.
Object    ' Name of object handeled.

Then when you open a report from a button or otherwise the following lines of code will log the event

dim EventType as string
dim ObjectToHandle
TypeOfEvent="PreviewReport"
ObjectToHandle="MyReportName"

DoCmd.RunSQL "INSERT INTO SD_EventLog ( Login, [DateTime], EventType, Object ) SELECT DISTINCTROW CurrentUser() AS Login, Now() AS [DateTime], '" & TypeOfEvent & "' AS EventType, '" & ObjectToHandle & "' AS Object;"

The code can be easily adapted to your needs.

The CurrentUser() function is used to ID the user. This function returns the ID the user logged on to Access with.


Hope this helps!
Trygve
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now