Results 1 to 4 of 4
  1. #1
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232

    Require data to be entered

    I have two text box (1) excetpedDate (2) exceptedBy I would like the exceptedBy text box to be required if the exceptedDate text box has a date.



    Thank You Angie

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Maybe field and/or textbox names should be AcceptedDate and AcceptedBy?

    You can set the fields in table as required and let Access nag users. Or use code behind form to validate data before record committed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    angie is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Dec 2013
    Posts
    232
    Quote Originally Posted by June7 View Post
    Maybe field and/or textbox names should be AcceptedDate and AcceptedBy?

    You can set the fields in table as required and let Access nag users. Or use code behind form to validate data before record committed.
    I would like to use code

    if me.status is “accepted” than
    me.acceptedby is required
    End if

    not sure how to word the required.

    Thanks Angie

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I forgot to mention ValidationRule and ValidationText properties of textbox.

    There are many examples of validation code in form BeforeUpdate event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 08-11-2016, 11:30 AM
  2. Replies: 14
    Last Post: 01-07-2014, 04:20 PM
  3. Replies: 2
    Last Post: 07-30-2012, 03:26 PM
  4. Require data in textbox
    By atom in forum Forms
    Replies: 5
    Last Post: 01-30-2012, 06:39 AM
  5. Replies: 2
    Last Post: 08-02-2011, 07:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums