Re: Audit Trail Problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks for your reply. How can I go about doing this? Do you have any
resources you recommend I read to get me started?

I'm guessing since you suggested SQL Sever tables, this is the best
direction to go. However, is there another route to get the new and original
number values from a form passed to the audit trail table? Below is the code
I'm using to get the user type, user id, table changed, and time changed
inserted into the audit table. As I mentioned before, I tried using
ctl.oldvalue & ctl.value properties but couldn't get them to work. Thanks
for all your help!


**********************************
Public Function AuditTrail(FormName As String)

Dim dbs As DAO.Database
Dim rst As DAO.Recordset

Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("tblAuditTrail")
With rst
.AddNew
.Fields("User") = UserID
.Fields("UserType") = UserType
.Fields("TimeChanged") = Now()
.Fields("TableChanged") = Form_MainMenu.cb_TableSelection
.Update
End With

ExitPoint:
On Error Resume Next
rst.Close
Set rst = Nothing
Set dbs = Nothing

End Function
*************************************

"Allen Browne" wrote:

> KatK, have you considered using SQL Sever tables instead of JET tables?
>
> You can still use the Access interface (well, it will need modifications),
> but use the SQL Server engine to provide transaction logs, or use triggers
> to generate just the details you want.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "KatK" <KatK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:D563C765-0C63-4414-8B5C-C6D8DF467F69@xxxxxxxxxxxxxxxx
> >I need to create an audit trail for my database. I have referred to Allen
> > Browne's audit trail and read all posts regarding audit trails. However,
> > my
> > database has 200+ tables and forms; therefore, Allen Browne's audit trail
> > example is not logical for me to use since I would have to create two
> > tables
> > for each table I already have (please correct me if I am wrong).
> >
> > For my database I have gotten part of my audit trail to work correctly.
> > My
> > username, time changed, table changed, and user type are working
> > correctly;
> > however, I can not get the previous value and new value to work. I have
> > tried using the OldValue and Value properties, but I can't get them to be
> > entered into my audit table.
> >
> > Any help would be wonderful! Thanks in advance!
>
>
>
.



Relevant Pages

  • Re: Audit Trail Problem
    ... SQL Server is a big topic on its own. ... > Dim rst As DAO.Recordset ... > Set dbs = CurrentDb ... >>>I need to create an audit trail for my database. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Allen Brown - Help, pls? Re: Tracking changes in database
    ... Audit Trail - Log changes at the record level ... Allen Browne - Microsoft MVP. ... Tips for Access users - http://allenbrowne.com/tips.html ... 35 and 40 users accessing the database. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Audit Tracking - Users
    ... Audit Trail - Log changes at the record level ... Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.forms)