Results 1 to 7 of 7
  1. #1
    JulieAHop is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Location
    Netherlands
    Posts
    15

    Validation Or not working

    Hi,

    I'm trying to set some validation rules on a field, each rule works alone but when together with an Or operand both rules are not validated.

    Here is what I am using..

    Nz(([PIG]>[SumOfQty])) Or (([PIG]+[COQtyDes])<=[COQty])


    Any ideas or pushes in the right direction would be greatly appreciated.

    Many thanks

    J

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Both suggests an and operand is needed?


    Sent from my iPhone using Tapatalk

  3. #3
    JulieAHop is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Location
    Netherlands
    Posts
    15
    Thx for your response. I need it to validate either not both.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    When you say both rules need to be validated, that means you will get all data where either one or the other are true. What results are you getting that don't apply to either rule?

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Why use nz here the first part will return true or false? So nz wouldn't apply.


    Sent from my iPhone using Tapatalk

  6. #6
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    either will return true or false
    ([PIG]>[SumOfQty]) Or (([PIG]+[COQtyDes])<=[COQty])
    If 6 > 5 Or 6+4<=20 evaluates to (1) OR (1) (True) OR (True)
    All other combinations are, of course, possible but the outcomes are basically the same. I agree with post #2 - the operand should be AND?

    If 6 > 5 AND 6+4 <= 20 (True) AND (True)
    then test passes?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    JulieAHop is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2017
    Location
    Netherlands
    Posts
    15
    Thank you all so much for your responses. It's now sorted. Your replies helped me get my head round something that in the end really was simple, I had just spent too long thinking and getting my brain cells in a tizwaz.

    Your help is very much appreicated - thanks guys And Or girls

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

Similar Threads

  1. Dcount - Validation not working
    By princess12 in forum Access
    Replies: 12
    Last Post: 02-10-2015, 02:05 AM
  2. Table validation - not working
    By Sheba in forum Forms
    Replies: 12
    Last Post: 08-06-2014, 08:14 AM
  3. Password validation not working
    By nika.duncan in forum Access
    Replies: 4
    Last Post: 11-22-2013, 11:01 AM
  4. Validation Rule Not Working??
    By tylerg11 in forum Forms
    Replies: 3
    Last Post: 12-23-2011, 02:22 PM
  5. Replies: 2
    Last Post: 10-02-2011, 01:27 PM

Tags for this Thread

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