John W. Colby
jwcolby at colbyconsulting.com
Sun Jan 9 23:42:09 CST 2005
I could do that. If it comes down to that I am examining a class for each control being tracked, with an Old/Newvalue property. If I want to use WithEvents to trigger the save of the data only when there is a modification to the control's data, then I have to have a class for each control type being tracked since a control object type cannot source events (it must be a specific type - combo, text etc). Doing it that way allows it to work for A2K (or even A97) as well as WinXP and beyond. I have toyed with that idea for logging the actual data changes which is a subject that comes up often on this list. I was really hoping to just use built in events to tell me that data changed, and if the data changes were undone. Sometimes Access can be so frustrating. Something like this should just already be there in the control class. If the undo events triggered correctly and reliably I would be done right now. Each control MUST know that it's data changes are undone, why doesn't it fire the event each and every time? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Lawrence Sent: Sunday, January 09, 2005 11:43 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Tracking real edits Hi John: Would it work if you took control yourself but simply saving the initial data settings, of the current record....then comparing for any differences. I use a similar technical, storing all the fields in a matching TYPE record and compare when moving or exiting. (It an old unbound habit....) HTH Jim -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John W. Colby Sent: Sunday, January 09, 2005 6:14 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Tracking real edits I have wondered for a long time how to track real edits. Issues: User starts to edit a field, hits the escape key and undoes edit. The AfterUpdate of a given control tells me the user started an edit. In Access XP the Escape causes OnUndo to fire, I can determine that the undo happened. Notice that A2K and previous do not even have OnUndo. However, if the user edits a control and leaves that control, then the AfterUpdate fires, I know the control was edited, but if they then hit Escape, the control edit is undone, but OnUndo DOES NOT FIRE, thus I incorrectly think that the control is still edited. My client wants to create date stamp fields for groups of fields, i.e. a NameDateStamp, AddressDateStamp, PhoneDateStamp etc. Thus I need to know that an edit happened and that the edit actually stored. I've never really figured out a satisfactory way to do this. Does anyone have a method that they use that appears to correctly handle all the nefarious things that a user can do? John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com