Roger's Access Library Homepage
Forum Home Forum Home > Other Download Libraries > MS Access MVP Libraries > Tejpal, A.D.
  New Posts New Posts RSS Feed - Forms_CheckReqdAndDuplicates.mdb
  FAQ FAQ  Forum Search   Events   Register Register  Login Login


Please consider donating $1 per sample downloaded, (find out why here)

Forms_CheckReqdAndDuplicates.mdb

 Post Reply Post Reply
Author
Message
A.D. Tejpal View Drop Down
Microsoft MVP
Microsoft MVP


Joined: 30 Jun 2008
Status: Offline
Points: 192
Post Options Post Options   Thanks (0) Thanks(0)   Quote A.D. Tejpal Quote  Post ReplyReply Direct Link To This Post Topic: Forms_CheckReqdAndDuplicates.mdb
    Posted: 08 Jul 2008 at 10:56pm
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: uploads/37/Forms_CheckReqdAndDuplicates.zip

--

Email: adtejpal@gmail.com
Back to Top
Sponsored Links


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down