Results 1 to 5 of 5
  1. #1
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317

    Restricting values in combo boxes

    Folks



    Here's another one. I promise I'm not planning on carpet bombing this forum with queries.

    When adding a combo box to a field in a table, is it possible to restrict the values so that they include only a subset of the entries in the relevant column from the source table?

    For example, Column A in Table 1 might contain a list of names, while Column B contains check boxes to state whether the people named are still alive. Column A in Table 2 might then contain combo boxes linking to Column A in Table 1. Would it be possible to restrict the values in the combo boxes so that they contained only names of people who were still alive?

    Remster

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Remster View Post
    Column A in Table 2 might then contain combo boxes linking to Column A in Table 1. Would it be possible to restrict the values in the combo boxes so that they contained only names of people who were still alive?

    Remster
    you will probably need a WHERE clause in the sql of the lookup function you're using. but...this should never been done at the table level. controls and sql statements do not belong there. see here: http://www.mvps.org/access/lookupfields.htm

  3. #3
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Quote Originally Posted by ajetrumpet View Post
    you will probably need a WHERE clause in the sql of the lookup function you're using. but...this should never been done at the table level. controls and sql statements do not belong there. see here: http://www.mvps.org/access/lookupfields.htm
    Thanks. So is the suggestion that they should be used in a form instead, or should I create an intermediate query?

  4. #4
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by Remster View Post
    Thanks. So is the suggestion that they should be used in a form instead, or should I create an intermediate query?
    always in the form. combos are populated with query strings usually

  5. #5
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    Many thanks.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  2. Replies: 2
    Last Post: 08-24-2009, 10:36 AM
  3. Replies: 10
    Last Post: 08-01-2009, 06:48 AM
  4. Replies: 7
    Last Post: 05-16-2009, 08:08 AM
  5. restricting combo box entry
    By fairlo in forum Forms
    Replies: 1
    Last Post: 10-04-2007, 04:05 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