The procedure for committing an update is similar for committing an Add,
except that we place the dynaset in edit mode using DbEdit and then assign the new dynaset values.
Since we use the same commit button and the same commit event procedure to add
and update, we introduce two global flags DoAdd and DoUpdate to distinguish
between adding and updating. The Add and Update click event procedures set these
flags.
The Commit event procedure for adding and updating does the following:
Validates entered data. Handles errors when necessary.
Uses DbAddNew to add records, else uses DbEdit for updates.
Assigns entered data to dynaset fields, using the Fields().Value property.
Updates database with new record, using DbUpdate.
Disables the Commit button.
Re-enables all other functional buttons including the Add and Update button.