Best way to determine which field (ctrl on form is updated) when Form is dirty

  • Thread starter Thread starter Marcel K.
  • Start date Start date
M

Marcel K.

Greetings - I need to update existing fields in record
displayed in unbound form - i need to capture the previous
value of the control (in this case a text box) then write
it to another table. I know how .dirty on form would
indicate that the something has changed - but I need to
explicity figure just the field that change and write the
prior value to another table. I guess I could use an edit
button, then it would indicate that change is about to
occur - Any input would be appreciated.

Regards,
Marcel.
 
Marcel K. said:
Greetings - I need to update existing fields in record
displayed in unbound form - i need to capture the previous
value of the control (in this case a text box) then write
it to another table. I know how .dirty on form would
indicate that the something has changed - but I need to
explicity figure just the field that change and write the
prior value to another table. I guess I could use an edit
button, then it would indicate that change is about to
occur - Any input would be appreciated.

On an *unbound* form? That is, one with no recordsource? I think the
only ways to do this are either:

1. execute code in each control's AfterUpdate event, setting some
module-level flag or variable indicating that the control has changed.
It occurs to me you might use the control's Tag property for this.

OR

2. Save the initial values of all controls in module-level variables
when they are first loaded. Then later you can loop through the
controls and compare their current values to the values you saved.

Note that unbound forms won't even have a Dirty property.
 
Back
Top