Creating an Audit Log

J

John Conklin

Hello all,

I found this wonder bit of information on Allen Browne's website dealing
with the subject above.
http://members.iinet.net.au/~allenbrowne/AppAudit.html

I have followed all the instructions to the letter, but it is not working
correctly for me.

I keep getting an error message that there is an error in my from clause,
and when I step through the code it looks correct to me.

As anyone had any luck using this solution? If so were there any problems
or things I might have missed when implementing.

Thanks
~John Conklin
 
T

tina

i implemented Allen's solution awhile back, and all ran smoothly; i don't
recall having to "fix" anything. suggest you post the line of code that is
erring out, maybe somebody will spot the problem.

hth
 
J

John Conklin

Thanks Tina,

Here is where the error log is saying the problem is:

If Not bWasNewRecord Then
sSQL = "INSERT INTO " & sAudTmpTable & " ( audType, audDate,
audUser ) " & _
"SELECT 'EditFrom' AS Expr1, Now() AS Expr2, NetworkUserName()
AS Expr3, " & sTable & ".* " & _
"FROM " & sTable & " WHERE (" & sTable & "." & sKeyField & " = "
& lngKeyValue & ");"
db.Execute sSQL, dbFailOnError

I get an error in my FROM clause.

~John
 
J

John Conklin

I figured out what the problem was.

Who ever created the database I am working on has all the table names with
spaces in the name like TBL - Header.

Once I changed the table name to tblHeader the code worked fine, and did
exactly what it was supposed to do.

Thanks
~John
 
Top