i had a similiar problem, except i was gettnig accused of chaning things and of course it couldnt be the user ;-)
so i set up a history table and on certaIN parts of the database i have the following sort of code , the function for WHOAMI and the DLL are at the bottom, the dll call needs to go at the top of the moduke
Private Sub Combo216_AfterUpdate()
Dim Mydb As Database
Dim MyreC As Recordset
Set Mydb = CurrentDb()
Set MyreC = Mydb.OpenRecordset("SELECT * FROM tblhistory"
With MyreC
.AddNew
![CptyID] = Me.Text189.Value
![CprtyName] = Me.Text187.Value
![OriginalStatusValue] = GetStatInTxt(StrOrig)
![NewStatusValue] = GetStatInTxt(Me.Combo216.Value)
![DateofChange] = Date
![ChangedBy] = WhoAmI
.Update
End With
Set Mydb = Nothing
Set MyreC = Nothing
StrOrig = Me.Combo216.Value
Me.tblhistory_subform.Form.Requery
End Sub
Public Function WhoAmI() As String
Dim lngret As Long
Dim lpBuffer As String
Dim nSize As Long
lpBuffer = String$(255, 0)
nSize = Len(lpBuffer)
lngret = GetUserName(lpBuffer, nSize)
If lngret = 0 Then
lpBuffer = String$(nSize, 0)
lngret = GetUserName(lpBuffer, nSize)
End If
WhoAmI = left(lpBuffer, nSize - 1)
End Function
Public StrOrig As Integer
Private Const SW_MINIMIZE = 6
Private Const SW_HIDE = 0
Private Const SW_NORMAL = 1
Private Const SW_MAXIMIZE = 3
Private Const ERROR_SUCCESS = 0
Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Private Declare Function ShowWindow Lib "user32" _
(ByVal hWnd As Long, ByVal nCmdShow As Long) As Long