The sample db demonstrates incorporation of following safeguards at data
entry stage.
(a) Ensuring that for a given record, mandatory fields get entered before
permitting data entry in any other field.
(b) Ensuring that in case of unique composite index, if data being entered in
any of the fields involved in such a combination would lead to creation of
duplicates, a friendly message is provided, and the irregular entry is un-
done.
Mandatory Fields (Property settings in source table: Required = Yes, Allow zero
length = No)
(1) Sole dependence upon form's Error event for generating a friendly
message, is by itself not adequate (This event fires only when the user tries
to save the record or move to another record).
(2) In order to ensure that even while staying at a given record, data entry in
other fields becomes feasible only after the mandatory ones have been
filled in, further programmatic support has been provided, some of the
salient features being -
(a) Controls pertaining to mandatory fields are identified by setting their tag
property = R (This facilitates super-check on blank/filled status of such
controls).
(b) Once the form gets dirty, mandatory controls in blank state get
highlighted in a special color.
(c) If any attempt is made to enter data in some other control while any of
the mandatory ones is still blank, the focus moves back to the first blank
mandatory control, after providing a suitable friendly message.
(d) Two styles are demonstrated.
(i) Tabbed form (mandatory controls on first page, other controls on
subsequent pages).
(ii) Datasheet form
Preventing duplicates in fields comprising composite unique index or primary key.
(1) Here too, sole dependence upon form's Error event for generating a friendly
message, is by itself not quite adequate, for reasons stated against 4.2 (1)
above.
(2) The sample demonstrates provision of super-check in exit event of controls
pertaining to composite unique index. If any entry is such as would lead to
duplication of combined field value, the entry is un-done and the exit event
gets cancelled, after providing suitable friendly message. The focus
continues to remain on the control in question. Download Access XP & 2K: http://www.rogersaccesslibrary.com/forum/uploads/37/Forms_CheckReqdAndDuplicates.zip - uploads/37/Forms_CheckReqdAndDuplicates.zip
------------- --
Email: mailto:adtejpal@gmail.com - adtejpal@gmail.com
|