Results 1 to 2 of 2
  1. #1
    tobe is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2012
    Posts
    1

    In Statement

    Sometimes there is no simple formula to define valid data, but there is a list of valid values. For example, you might require a state code in a U.S. postal address to be one of the 50+ that the U.S. Postal Service recognizes, or you might require a department name to be one of those in your company.


    The simplest way to handle this is to list them in the rule. The expression “IN (a, b, c,…)” does this. This evaluates as True if the entered value is a, b, c, up to as many as you have. (Replace a, b, c and so on with the valid values.) If items are text, put them in quotation marks. A rule to see if a location is one of your firm's offices might look like this:
    IN (“Boston”, “Paris”, “Sydney”, “Santiago”)



    I want to know how to do this for long list maybe just using a table?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Typically I'd use a combo that got its selections from a table, and set Limit to List to Yes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  2. Iif statement help
    By Firefighter22 in forum Queries
    Replies: 7
    Last Post: 09-30-2011, 10:59 AM
  3. SQL statement
    By sabrina in forum Queries
    Replies: 2
    Last Post: 09-30-2011, 03:10 AM
  4. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  5. IIf Statement...HELP!
    By bdhFS in forum Queries
    Replies: 5
    Last Post: 05-19-2010, 07:55 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