I have developed an application in MS Access 2002 that administers members and donations for a charity organisation. In one of the forms the so called gift aid declarations are maintained. A gift aid declaration consists basically of a from date and an until date. The from date is mandatory, the until date can be Null, meaning that the declaration is open. There may only be one open declaration per person.
To enforce this restriction i wrote a BeforeUpdate trigger on the until date.
Recently i was unpleasantly surprised to discover that in the office that uses my application some serious problems have arised because some persons have more than one open gift aid declaration! How could that be possible? I tested it really thoroughly. After some investigation i found the reason ...
In MS Access 2003, when creating a new record, the BeforeUpdate event on a field is not triggered when the field keeps its default value, Null in this case. But in MS Access 2002 it is! Have the developers of MS Access ever heard of backward compatibility?
First of all, it defies all logic: BeforeUpdate events are meant for validations (why else would there be a Cancel parameter?). For existing records that means indeed that the event should only be triggered on a change, but for new records it should of course always be triggered.
Secondly this has really created serious problems in the administration.
Last but not least, how should i validate field values of newly created records? I would have to use the OnExit event in this case, which is not very appropriate. It is a rather complex validation, and i want to avoid performing it more than necessary.
Does anyone have the same experience? Does anyone know if this change in MS Access 2003 is documented?
To enforce this restriction i wrote a BeforeUpdate trigger on the until date.
Recently i was unpleasantly surprised to discover that in the office that uses my application some serious problems have arised because some persons have more than one open gift aid declaration! How could that be possible? I tested it really thoroughly. After some investigation i found the reason ...
In MS Access 2003, when creating a new record, the BeforeUpdate event on a field is not triggered when the field keeps its default value, Null in this case. But in MS Access 2002 it is! Have the developers of MS Access ever heard of backward compatibility?
First of all, it defies all logic: BeforeUpdate events are meant for validations (why else would there be a Cancel parameter?). For existing records that means indeed that the event should only be triggered on a change, but for new records it should of course always be triggered.
Secondly this has really created serious problems in the administration.
Last but not least, how should i validate field values of newly created records? I would have to use the OnExit event in this case, which is not very appropriate. It is a rather complex validation, and i want to avoid performing it more than necessary.
Does anyone have the same experience? Does anyone know if this change in MS Access 2003 is documented?
Last edited: