Results 1 to 3 of 3
  1. #1
    jaworski_m is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    25

    Only one entry "yes" in the whole table

    Hello,
    I have a table with the following fields:

    versionID (PK)
    versionNumber
    changeDescr
    (...)
    actualVersion ("Yes"/"No") - (text field)

    I would like to set a validation rule at table level to make sure that there is only one entry [actualVersion]="Yes" in the whole table (the rest might be[actualVersion]="No")

    I tried the following but did not work.



    Code:
    =DCount("[actualVersion]";"tblChangeLog";"[actualVersion] = 'Yes'")=1
    How can I achieve this validation?

    Thank you for hints.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    If it's a Yes/No type field, that is a Boolean. Boolean parameter is not text and should not be delimited with apostrophes.

    =DCount("[actualVersion]", "tblChangeLog", "[actualVersion] = True")=1

    However, I've never set validation rule at table level, no idea if domain aggregate function will work.
    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
    jaworski_m is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    25

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

Similar Threads

  1. Replies: 5
    Last Post: 02-07-2014, 11:57 AM
  2. Replies: 9
    Last Post: 08-19-2013, 03:00 PM
  3. Replies: 5
    Last Post: 02-05-2013, 10:57 PM
  4. Replies: 7
    Last Post: 01-29-2012, 07:44 AM
  5. Replies: 1
    Last Post: 03-30-2011, 06:16 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