Results 1 to 6 of 6
  1. #1
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23

    Question Tricky Values in a Combo Box

    This one has me stumped to the point I'm not sure WHERE to begin:

    I have three source data tables: a 'program', an 'organization' and a 'role' that a person can have within that program and organization.

    Some roles allow multiple members (like programmers) whereas some roles allow only one (for example, the Team Lead).

    So here is my delimma:



    If I want to assign an individual to a specific program and organization, The role choices that I want in the combo box are roles not occupied. I don't want to use 'flags' to say a position is available, because of the number of roles, programs and organizations.

    I should be able to limit the choices in the list box to the roles that are 'available'.

    Remember, some roles allow as many individuals as I want, other roles have to be vacant.

  2. #2
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23
    ok..I have a query (based on the values selected in ComboBoxes on a form) that returns the values of the 'privilidged' roles that are filled, based on the program and organization.

    Can I turn the rows into a 'not in list' type of where criteria for the record source for the combo box?

    So if the query says 'someone is filling role_id 4', the role associated with role_id 4 is not a choice. But all other role-IDs are available.

    Remember the query can return multiple rows (3 and 4) if those restricted Role_IDs are filled. Those choices should not be available, as they are already filled.
    Last edited by vt800c; 05-17-2011 at 09:27 AM. Reason: clarification of process...and punctuation/capitalization

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    There is a free video here that deals with the concept of showing a value in one box or another. Basically there is a list of Available things, and a list of Already Taken things.
    The video shows how to set it up and how to move things from one list to the other.

    It's well work the 5 minutes to see how it's done, and you may be able to apply the concept in your case.

    http://www.datapigtechnologies.com/f...tboxtrick.html

  4. #4
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23
    Thanks for your suggestion, Orange. I will see if there is a way I can use the data structures I already have to implement your idea. It may be that I need to make an intermediate query that displays only the values desired, and have that as a dynamic recordset that is requeried on each time a 'controlling' value on theparent form is changed. Let me give that some thought...

  5. #5
    vt800c is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    23
    forget it...I handled it another way, with checking the selected value in the BeforeUpdate event of the field. if it's a restricted role that is already filled, I'll display a messagebox and cancel the change. Simple, and it works.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Thanks for posting that you got it resolved.

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

Similar Threads

  1. Preventing other values in combo box
    By cheese9799 in forum Forms
    Replies: 3
    Last Post: 02-14-2011, 03:31 PM
  2. Replies: 1
    Last Post: 04-01-2010, 05:40 PM
  3. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  4. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  5. Replies: 3
    Last Post: 02-26-2009, 10:17 AM

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