G
Guest
I am frusterated!
I'm trying to implement Allen Brownes Audit Log code in Access XP and am running into a series of problems. Could i have some help? I would really appreciate it
Problem one
Runtime error 13: Data type mismatc
Code highlighted is
Set db = DBEngine(0)(0
I am not that strong of a VB coder so am not sure about DAO and ADO stuff and how it all works. Here is the full code in this block
Dim db As CurrentProject ' Current databas
Dim sSQL As Strin
'Remove any cancelled update still in the tmp table
Set db = DBEngine(0)(0
sSQL = "DELETE FROM " & sAudTmpTable & ";
db.Execute sSQ
' If this was not a new record, save the old values
If Not bWasNewRecord The
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 ', dbFailOnErro
End I
AuditEditBegin = Tru
Exit_AuditEditBegin
Set db = Nothin
Exit Function
I'm trying to implement Allen Brownes Audit Log code in Access XP and am running into a series of problems. Could i have some help? I would really appreciate it
Problem one
Runtime error 13: Data type mismatc
Code highlighted is
Set db = DBEngine(0)(0
I am not that strong of a VB coder so am not sure about DAO and ADO stuff and how it all works. Here is the full code in this block
Dim db As CurrentProject ' Current databas
Dim sSQL As Strin
'Remove any cancelled update still in the tmp table
Set db = DBEngine(0)(0
sSQL = "DELETE FROM " & sAudTmpTable & ";
db.Execute sSQ
' If this was not a new record, save the old values
If Not bWasNewRecord The
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 ', dbFailOnErro
End I
AuditEditBegin = Tru
Exit_AuditEditBegin
Set db = Nothin
Exit Function