Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2015
    Posts
    1

    When Validation Rule Fails, Nothing Entered in Query is Accepted

    This is a pretty straight forward example. I have a table of names, and a table to be populated with email addresses.

    I have a validation rule to make sure email addresses are valid.

    I have a query that will return a list of names that don't yet have email addresses. The idea is that from the query, I can enter in any missed emails. The problem is if I enter an invalid e-mail address into the query, it flags the validation rule text, but then somehow loses it link to the name list and starts giving referential integrity errors. Check out this example and let me know what I'm doing wrong.

    To replicate issue:
    1. Open qryNeedsEmail
    2. Type an invalid email address in the Email field (ie google.com)
    3. Hit OK to the error message
    4. Try either deleting the invalid message or entering in a valid email. Both will give you an error about nothing valid being entered in the Name IDFK field.


    This appears to be because the IDFK field isn't filled out if the e-mail record isn't valid. I think I'm missing something really simple, but can't wrap my mind around it. Thanks for the help!
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    it seems to work fine if you follow the rules.
    I for one , never put these validations on the table. Instead I enforce it via a form in a text box.

    In yours, if you try to enter data without the correct email, AND the correct child key, youll get an error. (because of the relationship)
    you must have a parent key.
    You should NEVER let users enter data straight into the table esp, with relationships. Always enter data in a form / subform.

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

Similar Threads

  1. help in validation rule
    By Mohaisen in forum Access
    Replies: 12
    Last Post: 08-03-2015, 01:05 PM
  2. Replies: 2
    Last Post: 06-16-2015, 03:52 AM
  3. Validation Rule
    By noob123 in forum Access
    Replies: 1
    Last Post: 12-02-2013, 03:39 PM
  4. IIf in Validation Rule
    By Bugsy in forum Access
    Replies: 6
    Last Post: 11-21-2011, 11:33 AM
  5. Validation Rule
    By Megan in forum Access
    Replies: 1
    Last Post: 11-05-2010, 09:45 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