Audit log for 1 field

B

BenEl

Hi. I am trying to create an audit log for a "tasks" database.I used Allen
Browne's code and got it working on a very simple test database. When I try
to do the exact thing in my production database, it gets stuck at:

'Remove any cancelled update still in the tmp table.
Set db = DBEngine(0)(0)
sSQL = "DELETE FROM " & sAudTmpTable & ";"
db.Execute sSQL

My production form has alot on it (combo lookups, date pickers, option groups,
and some code behind some text boxes, etc). Would this affect it? I'm really
only interested in tracking changes from 1 field. How can I modify Allen's
code to do this and stop erroring out?

Thanks!
 
D

Douglas J. Steele

What does "gets stuck" mean? Do you get an error? If so, what's the error?
 
B

BenEl via AccessMonster.com

"Syntex error in FROM clause".

I don't understand this error, because the code is copied straight from
Allen's website and worked perfectly in my test dbase.

What does "gets stuck" mean? Do you get an error? If so, what's the error?
Hi. I am trying to create an audit log for a "tasks" database.I used Allen
Browne's code and got it working on a very simple test database. When I
[quoted text clipped - 14 lines]
 
D

Douglas J. Steele

If sAudTmpTable contains special characters (which includes spaces), try

sSQL = "DELETE FROM [" & sAudTmpTable & "];"

If it doesn't, what's the actual content of sSQL when the code fails?


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


BenEl via AccessMonster.com said:
"Syntex error in FROM clause".

I don't understand this error, because the code is copied straight from
Allen's website and worked perfectly in my test dbase.

What does "gets stuck" mean? Do you get an error? If so, what's the error?
Hi. I am trying to create an audit log for a "tasks" database.I used
Allen
Browne's code and got it working on a very simple test database. When I
[quoted text clipped - 14 lines]
 
B

BenEl via AccessMonster.com

So that worked! Now I'm getting the error:

" SELECT* can not be used in an INSERT INTO query where the source or
destination table contains a multivalued field".

I have a few of these. I don't want to capture the changes for these fields.
How can I adopt the code to only look at one specific field?

Thanks.

If sAudTmpTable contains special characters (which includes spaces), try

sSQL = "DELETE FROM [" & sAudTmpTable & "];"

If it doesn't, what's the actual content of sSQL when the code fails?
"Syntex error in FROM clause".
[quoted text clipped - 9 lines]
 
D

Douglas J. Steele

In AuditEditEnd, you have to change sSQL so that it picks selected fields,
not *.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


BenEl via AccessMonster.com said:
So that worked! Now I'm getting the error:

" SELECT* can not be used in an INSERT INTO query where the source or
destination table contains a multivalued field".

I have a few of these. I don't want to capture the changes for these
fields.
How can I adopt the code to only look at one specific field?

Thanks.

If sAudTmpTable contains special characters (which includes spaces), try

sSQL = "DELETE FROM [" & sAudTmpTable & "];"

If it doesn't, what's the actual content of sSQL when the code fails?
"Syntex error in FROM clause".
[quoted text clipped - 9 lines]
 
B

BenEl via AccessMonster.com

Thanks. Unfortunately the user has decided that they would now like to be
able to modify past entries...Onto a new tactic!
In AuditEditEnd, you have to change sSQL so that it picks selected fields,
not *.
So that worked! Now I'm getting the error:
[quoted text clipped - 18 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top