Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

How to do the event log in Access 97?

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
seanyeo
Asked:
seanyeo
  • 3
1 Solution
 
TrygveCommented:
Could you please refrase the question.

Do you want to log the users activity or do you want to do user administration ?
0
 
cymbolicCommented:
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
 
TrygveCommented:
No such thing as .startlogging and .logevent in Access 97 as far as I know.
0
 
seanyeoAuthor Commented:
Beside the VB5.0 Method, have anyway to do it in Access 95.
0
 
TrygveCommented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now