473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

tracking users

I have a multi user database that I would like to be able to track user
actions. Ex Whenever a user creates a new employee record, I would
like to "stamp" their id on the record as the one that created it.
Also, whenever they run a report, I would like their id automatically
printed on the report as the one running it.
How to do this?

Oct 13 '06 #1
3 3185
Ryker wrote:
I have a multi user database that I would like to be able to track user
actions. Ex Whenever a user creates a new employee record, I would
like to "stamp" their id on the record as the one that created it.
Also, whenever they run a report, I would like their id automatically
printed on the report as the one running it.
How to do this?
If you have security installed, check out CurrentUser in help.
MsgBox("The current user is: " & CurrentUser)

If security is not installed then everyone's Admin. Maybe this link
http://www.mvps.org/access/api/api0066.htm will get you a name retrieval
method that's suitable.

Once you can get the name or loginid to Access, the rest is easy enough.
Oct 13 '06 #2
Wack this code into a new module, then call fntUserId and it will return the
NT user name

ie msgbox fntUserId()

=======================
Option Compare Database
Option Explicit

Public gstrUserId As String
Declare Function nmGetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, nSize As Long) As Long
Public Function fntUserId() As String
'get the loginid of the current NT user
Dim strBuffer As String * 20
Dim lngLenBuffer As Long
Dim lngOk As Long
lngLenBuffer = 20
lngOk = nmGetUserName(strBuffer, lngLenBuffer)
gstrUserId = Left(strBuffer, InStr(1, strBuffer, Chr(0)) - 1)
fntUserId = uCase(gstrUserId)
End Function
=======================
"Ryker" <ra*****@choctaw.orgwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
>I have a multi user database that I would like to be able to track user
actions. Ex Whenever a user creates a new employee record, I would
like to "stamp" their id on the record as the one that created it.
Also, whenever they run a report, I would like their id automatically
printed on the report as the one running it.
How to do this?

Oct 15 '06 #3
Thanks, I will give this a try.
tombsy wrote:
Wack this code into a new module, then call fntUserId and it will return the
NT user name

ie msgbox fntUserId()

=======================
Option Compare Database
Option Explicit

Public gstrUserId As String
Declare Function nmGetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, nSize As Long) As Long
Public Function fntUserId() As String
'get the loginid of the current NT user
Dim strBuffer As String * 20
Dim lngLenBuffer As Long
Dim lngOk As Long
lngLenBuffer = 20
lngOk = nmGetUserName(strBuffer, lngLenBuffer)
gstrUserId = Left(strBuffer, InStr(1, strBuffer, Chr(0)) - 1)
fntUserId = uCase(gstrUserId)
End Function
=======================
"Ryker" <ra*****@choctaw.orgwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
I have a multi user database that I would like to be able to track user
actions. Ex Whenever a user creates a new employee record, I would
like to "stamp" their id on the record as the one that created it.
Also, whenever they run a report, I would like their id automatically
printed on the report as the one running it.
How to do this?
Oct 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: hawkon | last post by:
Hi all, I have an important question to ask about how to trap events when the user close the browser window. I'm a ASP programmer and I have s MSSQL database with a user table where I'm able to...
5
by: byrocat | last post by:
Sybase and DB2 both have the capability of tracking user activities at a number of levels: invalid access attempts to databases, table, etc.; creation/deletion/modification of database...
1
by: Annette Massie | last post by:
Does anyone have a solution for tracking hardware, os and office products for their organization? We are looking for a way to track this information and then assign it to an employee and track its...
4
by: Tim Graichen | last post by:
Does anybody have code for real geneology tracking through many generations? And maybe an associated family tree report? Tim
1
by: fred tate via .NET 247 | last post by:
I'm working on a project that will track a great deal of data forindividuals and will keep track of users for a very long time (5- 10) years. I'm looking for options as far as tracking anddisplaying...
2
by: Shaw | last post by:
We develop ASP.NET based web application for a while, and don’t have defect (bug) reporting and tracking system for development right now. We consider using defect report and track software....
10
by: CJ Taylor | last post by:
Hey anyone know of a good (and possibly even low cost) bug tracking software? Preferably web based... -CJ
1
by: kasterborus | last post by:
Hi, My client is using the UBB Threads forum and I was recently asked to look into adding the ability to track the activity of each of the users to see who is more active than others. Users are...
2
by: C# programmer | last post by:
Hi All, I'm working on a project which requires tracking of recent document downloads. There is a feature in which user can download the docs without logining into the website for some of the...
0
by: LiveTecs | last post by:
http://www.livetecs.com TimeLive Web Collaboration Suite is an integrated suite that allows you to manage project life cycle including tasks, issues, bugs, timesheet, expense, attendance. ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.