Solved

How to do the event log in Access 97?

Posted on 1997-12-16
5
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

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…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

749 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