kawther said:
good morning,
is it possibile to create a log report for any changes done by the user.
i.e
user1 insert record one, user2 delete second row and so on.
thank you in advance
Yes but it's not an "out of the box" solution, you have to code it yourself.
Here's an example of code that works well for me. It assumes several
things, including having certain tables and queries in place but you should
be able to work all that out from the code. Hope it helps.
Keith.
www.keithwilby.com
Public Function libHistory(frmForm As Form, lngID As Long, strTrans As
String)
'Author: Keith Wilby
'Date: 05 July 2005
'Purpose: Record data transactions in tblHistory
'Called from: Form_BeforeUpdate & Delete events
Dim ctl As Control
Dim db As DAO.Database, rs As Recordset, strSQL As String, strUser As
String
Set db = CurrentDb
strSQL = "Select * From qryHistory;"
Set rs = db.OpenRecordset(strSQL)
strUser = fOSUserName()
For Each ctl In frmForm
'Ignore controls such as labels
If TypeOf ctl Is TextBox or TypeOf ctl Is ComboBox Then
'Record null to value, value to null, and value changes
If ((IsNull(ctl.OldValue) And Not IsNull(ctl.Value)) Or
(IsNull(ctl.Value) And Not IsNull(ctl.OldValue)) _
Or ctl.OldValue <> ctl.Value) Then
With rs
.AddNew
![DataSource] = frmForm.Name
![ID] = lngID
![FieldName] = ctl.ControlSource
![OldValue] = ctl.OldValue
![NewValue] = ctl.Value
![UpdatedBy] = strUser
![UpdatedWhen] = Now()
.Update
End With
End If
End If
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End Function