Counting the number of changes to a record

vangogh228

Registered User.
Local time
Today, 18:13
Joined
Apr 19, 2002
Messages
302
Hello all.

Is it possible to count the number of times data is edited in a specific record after the original is created? I have discussed this issue with the area that has this need, and all seem accepting of the thought that they may have to make it a habit of clicking a button rather than having some auto-counter in the background.

But... and there's always a but...

I have no idea if this is even possible, how it might be done through some form code, or even how I could create a counter code that would be edited by a form's button click. I have thought about this for a while, tried to search on it but came up with nothing, and am considering the possibility I may not be able to accomplish this.

Any help is greatly appreciated.
 
Solved

Never mind, all.

I bound a form "counter" field to the record's table, defaulted to 0, and set a button with an OnClick event that reads "Me.Counter = Me.Counter + 1" . That seems to have done it. I'll just have them indicate their changes manually by clicking the button.
 
i haven't done anything like that before but... after writing that i have done it.

if the counting field is in the same table as the record you editing the code will be pretty much the same.

1st change the default value of the [EditNo] - the field holding the count - to -1
this is because it will increment to 0 after a record is added (meaning the number of edits will start at 0).

2nd add this code to the form your editing

Private Sub Form_Dirty(Cancel As Integer)
Me![EditNo] = [EditNo] + 1
End Sub
 
dam too slow... but the code above will do it automatically
 
Great!

Hey.... that's MUCH better than what I was going to do. I'll try that right now! THANKS!!!
 

Users who are viewing this thread

Back
Top Bottom