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

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.
 
D

Dirk Goldgar

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.
 
G

Guest

Thanks for this information - This is the help I desired -
it is most useful.

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top