Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Audit log for 1 field

0 views
Skip to first unread message

BenEl

unread,
Nov 24, 2009, 4:18:58 PM11/24/09
to
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!

Douglas J. Steele

unread,
Nov 24, 2009, 5:23:04 PM11/24/09
to
What does "gets stuck" mean? Do you get an error? If so, what's the error?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"BenEl" <u56454@uwe> wrote in message news:9f9c5f2324d32@uwe...

BenEl via AccessMonster.com

unread,
Nov 25, 2009, 9:08:57 AM11/25/09
to
"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.


Douglas J. Steele wrote:
>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]
>>
>> Thanks!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200911/1

Douglas J. Steele

unread,
Nov 25, 2009, 10:51:27 AM11/25/09
to
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
http://I.Am/DougSteele

(no e-mails, please!)


"BenEl via AccessMonster.com" <u56454@uwe> wrote in message
news:9fa530926c82e@uwe...

BenEl via AccessMonster.com

unread,
Nov 25, 2009, 1:40:17 PM11/25/09
to
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.


Douglas J. Steele wrote:
>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]

Douglas J. Steele

unread,
Nov 25, 2009, 3:14:20 PM11/25/09
to
In AuditEditEnd, you have to change sSQL so that it picks selected fields,
not *.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"BenEl via AccessMonster.com" <u56454@uwe> wrote in message

news:9fa78f1eb9a06@uwe...

BenEl via AccessMonster.com

unread,
Nov 30, 2009, 1:17:22 PM11/30/09
to
Thanks. Unfortunately the user has decided that they would now like to be
able to modify past entries...Onto a new tactic!

Douglas J. Steele wrote:
>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]

0 new messages