I work in the medical field and I need to construct a database of part numbers that tracks who has approved them for deployment (about five approvers), candidate countries for deployment, and which countries eventually received approval. I need to be able to look at the history of who did what to my database and when. Is there an easy way to do this with Microsoft Access?
In Microsoft Access, 2007, is there a way to track changes?adware
This looks scary, but try it. It will get the user's Windows log in name for you. Create new a module (a module is an object just like tables, reports, forms etc) and paste this block of code in it right under where it says "Option Compare Database"
Global strGetUserName As String
Private Declare Function GetUserNameAPI Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public Function GetUserName() As String
Dim sBuffer As String
Dim lSize As Long
Dim db As DAO.Database
Dim SQLString As String
Dim rs As DAO.Recordset
Dim mySecurityRole As String
Dim prm As DAO.Parameter
Dim qdf As QueryDef
Set db = CurrentDb
sBuffer = Space$(255)
lSize = Len(sBuffer)
Call GetUserNameAPI(sBuffer, lSize)
If strGetUserName = "" Then
No comments:
Post a Comment