List of updated fields

  • Thread starter Thread starter GregW
  • Start date Start date
G

GregW

I have a change history log that tracks the user name,
date, and record anytime a record is changed. I have this
tied to the form's AfterUpdate property. Is there any way
to retrieve a list of the fields that were updated and put
them in one field of my history table?
 
GregW said:
I have a change history log that tracks the user name,
date, and record anytime a record is changed. I have this
tied to the form's AfterUpdate property. Is there any way
to retrieve a list of the fields that were updated and put
them in one field of my history table?

In the form's BeforeUpdate event, you could loop throught the bound
controls on the form and compare each control's Value property with its
OldValue property. When the properties are not equal (and are not both
Null), then the control has been updated. I think you'd want to store
the list of updated fields in a module-level variable so that you can
pick it up in the AfterUpdate event.
 
Is there any way
to retrieve a list of the fields that were updated and put
them in one field of my history table?

Not directly, I don't think. But you can use the form's BeforeUpdate event
and compare a control's 'OldValue' with 'Text' value and see if there're
any changes and build a list this way. You might need to set focus on
individual editable controls to get to the uncommitted value.

-- Dev
 
Dev Ashish said:
Not directly, I don't think. But you can use the form's BeforeUpdate
event and compare a control's 'OldValue' with 'Text' value and see if
there're any changes and build a list this way. You might need to
set focus on individual editable controls to get to the uncommitted
value.

Dev -

Can there be an uncommitted value in the form's BeforeUpdate event?
 
Can there be an uncommitted value in the form's BeforeUpdate event?

Oops, I should've realized. All the values would be uncommitted in
BeforeUpdate, right?

Thanks
-- Dev
 
Dev Ashish said:
Oops, I should've realized. All the values would be uncommitted in
BeforeUpdate, right?

I'm pretty sure all values would be committed already in
Form_BeforeUpdate.
 
Back
Top