Results 1 to 6 of 6
  1. #1
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44

    Question Allow blank within validation rule


    In my text box, txt2_itp_1, allowable values are blank, 0, 1, 2, 98, or 99. When I use the following validation rule,

    [txt2_itp_1]="" Or "0" Or "1" Or "2" Or "98" Or "99", Access doesn't allow the user to leave the field blank.

    I tried [ISNULL] instead of "", and got the same result, an error message telling me to enter a valid number. I've found plenty of ways to require a field to be filled in, but none to allow a selection of values that includes null.

    How do I do this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is this a BOUND textbox? Is it bound to a number field?

    [txt2_itp_1]=0 Or 1 Or 2 Or 98 Or 99 Or Is Null
    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
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    It's bound to a numeric field called 2_itp_1.

  4. #4
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    I just tried your revised syntax, [txt2_itp_1]=0 Or 1 Or 2 Or 98 Or 99 Or Is Null, and it worked. Thanks much!!

    I had tried IS Null at the beginning of the rule and it didn't work. do you know why it works at the end but not the beginning?

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    No idea but I do remember having the same issue.
    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.

  6. #6
    hilian is offline Advanced beginner
    Windows XP Access 2003
    Join Date
    May 2012
    Posts
    44
    Oh Well. But at least there's one way it works. Thanks!

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

Similar Threads

  1. Replies: 2
    Last Post: 06-16-2015, 03:52 AM
  2. IIf in Validation Rule
    By Bugsy in forum Access
    Replies: 6
    Last Post: 11-21-2011, 11:33 AM
  3. Validation Rule
    By rbiggs in forum Forms
    Replies: 4
    Last Post: 08-23-2011, 05:24 PM
  4. Help with validation rule
    By Desstro in forum Programming
    Replies: 5
    Last Post: 02-27-2011, 08:05 PM
  5. Validation Rule
    By Christopher in forum Forms
    Replies: 15
    Last Post: 04-20-2010, 06:05 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