Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Forcing data entry (2003)

    I have a form containing a sub form. I want to force the user to supply data in the sub-form. I've tried putting on the 'Required' property for the fields in the relevant table (the two fields which comprise the sub-form are bound to these fields) but it's not good enough; it's still possible to move to another record/close the form without completing the sub-form.
    How can this requirement to make the user provide sub-form data be achieved, please?
    Thanks
    Silverback
    Silverback

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Forcing data entry (2003)

    The Required property of fields, and the Before Update event of the subform only take effect if the user has entered anything in the record. If the user leaves the subform untouched, there is no record for which Required or Before Update can come into play.

    A possible solution is to set the AllowAdditions property of the main form to No, so that the user cannot add a new record there. Provide an unbound form in which the user can enter data for a new parent record *and* for a corresponding child record. The code behind the "OK" button on this unbound form checks that all required data have been filled in, then creates a parent record and child record.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Forcing data entry (2003)

    Many thanks for this reply. Discussing it with the user it became clear that there were (previously unspecified) requirements which could be implemented by forcing a dummy (Sector 0) entry for each new volunteer ie it signals that they are willing to help but have not helped in the past. If the user forgets to put it in, the DB now does it for them. This solution means there is no longer the danger of an 'orphan' volunteer who exists in the name table but does not appear in the reports which are based on who marshalled which sector in a particular year. (This is why I asked about how to force a user to provide info in the subform)
    However, although the report by sector and year now correctly lists out all the volunteers, the user would like to have Sector 0 replaced by the word Unassigned , while still having the other sectors in the report detailed as Sector 1, Sector 2 etc.
    How can this be achieved, please?
    Thanks
    Silverback
    Silverback

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Forcing data entry (2003)

    You should be able to use an expression with IIf or with Replace to change Sector 0 into Unassigned.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •