Results 1 to 4 of 4
  1. #1
    lima is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    4

    Validation Rule in Multi Value Field


    I created a field in access 2010 called OptionalSubjects . It is a multi value field where a user can select multiple values from the combo box, the selection are ID from a query. Now i want to limit the user to only two selection from the multiple values available and not less than two. So the field is either NULL or two selection only. how can i achieve this in validation rule or vba. Thanks in Advance

  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
    I don't think you can. I NEVER use multi-value field. They are problematic and difficult to manage.
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    I wouldnt put the rule in (yes problems) BUT you can put it in the form (as logic , not rule)...
    let the form count the # of objects in the field, and allow or deny based on that.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    ranman, do you know code to count items in multi-value field? The only way I can imagine would be to open recordsets - open parent recordset of table records then open multi-value field child recordset based on the parent recordset. http://msdn.microsoft.com/en-us/libr...ffice.12).aspx
    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: 3
    Last Post: 07-03-2013, 01:35 PM
  2. Replies: 3
    Last Post: 05-02-2012, 04:05 AM
  3. Validation rule for a month field
    By Alliana Gray in forum Access
    Replies: 7
    Last Post: 08-11-2011, 12:41 PM
  4. Referencing table data in field validation rule
    By toad848 in forum Database Design
    Replies: 3
    Last Post: 03-19-2009, 07:03 AM
  5. Validation rule for a text field
    By wasim_sono in forum Forms
    Replies: 4
    Last Post: 03-14-2006, 11:39 PM

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