Solved Add date when particular field updated

ClaraBarton

Registered User.
Local time
Yesterday, 19:31
Joined
Oct 14, 2019
Messages
685
I have a form that shows the date a record was created.
Before updating I have a date field for when a record was modified.
Now I'd like to automatically add the date when a rep takes over a client. This would be when a rep ID is added to the record from a combo box.
I don't want this date to change when the record is modified in any other way. How would I do this?
 
In the after update event of the combobox, test if your date field is null. If it is null add the date. if it is not null do nothing.
 
There are events associated with individual controls. The way I would approach this is:

With knowledge that you are looking for a change of clients, I would have the current "client of record" recorded in a variable during the Form_Current routine. Then, in the particular combo box, I would use either the _Click or _LostFocus routine to compare the current value of the variable vs. the current value of the control. IF they don't match, load up your new date. If they are the same, do nothing.

EDIT: And Moke123 would use _AfterUpdate. Tomato - tomahto.
 
Last edited:
It's always tricky. If a user changes the combo choice, you record the change, and then the user presses Esc to undo the change, can you unwind your change record?
 

Users who are viewing this thread

Back
Top Bottom