Selasa, 01 Oktober 2013

[MS_AccessPros] RE: Help with creating record change history

 

Personally, I keep a LOG table to track changes to any fields I want to watch or save a history for. In those fields, just use an AfterUpdate event with a single INSERT SQL statement to put that data in the log:


docmd.runsql "INSERT INTO..."


Now you can use the new value and the .OldValue to track what the field WAS set to, and what it is now. I cover this plus setting up your own user accounts (to track WHO made the change) in my Access Security Seminar. Microsoft removed user-level security from Access 2007, so you have to set up user logons and tighten down the database yourself now manually... but it's not that hard.


Hope this helps.


Richard Rost

http://599cd.com/XMASP



 



---In ms_access_professionals@yahoogroups.com, <desertscroller@...> wrote:

Thanks Stuart, that is exactly what I was looking for.  It will make things a lot easier.

Again thanks.

Rod



---In ms_access_professionals@yahoogroups.com, <saitchison@...> wrote:

Rod, Hi:

 

As far as I am aware (in that I have already used this facility) there is a property assigned to a field that gives you the old value.

 

You should be able to get it this way:  Me.conContactID.OldValue, where you would substitute your field name for the "conContactID" (i.e. the field name) bit.

 

Stuart Aitchison

 

 

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of dave@...
Sent: Mon, 30 September 2013 00:14 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Help with creating record change history

 

 


I usually capture the "current value" of the field durring the OnClick
event and assign it to a variable. Then durring the After Update event
use the variable and the new value in a docmd.runsql to append a new
record into an Activities table or Changes table kind of thing.

Quoting desertscroller@...:

I have a database with multiple users. When the users make changes to
the records; i.e., update fields on the records I would like to append
simple notes in a memo field which would indicate changes made
including user and date of change. Currently I only use a
message/response box to insure that user wants to overwrite existing
data. I think I can test the various editable fields as being dirty
but not sure how to retrieve the original value to be used in the note
being created.
My current approach is to use temp (original values) variables to
compare with new values. At typical note would be:
Due date changed from 9/20/13 to 10/15/13 by John on 9/12/13
Question are the pre-dirty values available before updating the
records?
Thanks for any help. (Using Access 2010 on Windows 7)
Rod

Links:
------
[1]
mailto:desertscroller@...?subject=Re%3A%20Help%20with%20creating%20record%20change%20history
[2]
mailto:MS_Access_Professionals@yahoogroups.com?subject=Re%3A%20Help%20with%20creating%20record%20change%20history
[3]
http://groups.yahoo.com/group/MS_Access_Professionals/post;_ylc=X3oDMTJlb2h0dnVlBF9TAzk3MzU5NzE0BGdycElkAzY0NDg5NzgEZ3Jwc3BJZAMxNzA1MTE1MzcwBHNlYwNmdHIEc2xrA250cGMEc3RpbWUDMTM4MDQ4MTE3Nw--
[4]
http://groups.yahoo.com/group/MS_Access_Professionals/message/105251;_ylc=X3oDMTM4c29uZmtmBF9TAzk3MzU5NzE0BGdycElkAzY0NDg5NzgEZ3Jwc3BJZAMxNzA1MTE1MzcwBG1zZ0lkAzEwNTI1MQRzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzEzODA0ODExNzcEdHBjSWQDMTA1MjUx
[5]
http://groups.yahoo.com/group/MS_Access_Professionals/members;_ylc=X3oDMTJmdDJ2NTg2BF9TAzk3MzU5NzE0BGdycElkAzY0NDg5NzgEZ3Jwc3BJZAMxNzA1MTE1MzcwBHNlYwN2dGwEc2xrA3ZtYnJzBHN0aW1lAzEzODA0ODExNzc-?o=6
[6]
http://groups.yahoo.com/group/MS_Access_Professionals;_ylc=X3oDMTJldGlzYjQxBF9TAzk3MzU5NzE0BGdycElkAzY0NDg5NzgEZ3Jwc3BJZAMxNzA1MTE1MzcwBHNlYwN2dGwEc2xrA3ZnaHAEc3RpbWUDMTM4MDQ4MTE3Nw--
[7]
http://groups.yahoo.com/;_ylc=X3oDMTJkbGloNTcwBF9TAzk3NDc2NTkwBGdycElkAzY0NDg5NzgEZ3Jwc3BJZAMxNzA1MTE1MzcwBHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMzgwNDgxMTc3
[8]
mailto:MS_Access_Professionals-traditional@yahoogroups.com?subject=Change
Delivery Format: Traditional
[9]
mailto:MS_Access_Professionals-digest@yahoogroups.com?subject=Email
Delivery: Digest
[10]
mailto:MS_Access_Professionals-unsubscribe@yahoogroups.com?subject=Unsubscribe
[11] http://info.yahoo.com/legal/us/yahoo/utos/terms/
[12] mailto:ygroupsnotifications@yahoogroups.com?subject=Feedback on
the redesigned individual mail v1

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar