Results 1 to 6 of 6
  1. #1
    nycman is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    31

    How do I make a record disappear from the combobox list once used!

    Hi There,

    Short and sweet, I have a table with 8 employees and a table with 3 supervisors. I have a form where I can select a supervisor (combobox) and also select the employees (combobox) that "belongs" to that supervisor. How do I make an employee "disappear" from the choice list once is assigned to a supervisor so I don't assign the same person to more than one supervisor.



    thanks for your help

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Link the list of employees to the junction table that contains your supervisor/employee matrix and put a criteria of IS NULL in the supervisor field of the junction table field. This should filter out any person who has been assigned a supervisor.

  3. #3
    nycman is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    31
    You said "put a criteria of IS NULL in the supervisor field" - Does this mean that I should create a query and do this in the query?!. I can't find criteria field in the table? Sorry I'm very novice in this.

    thanks

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Yes, base your combo box on a query, not a table. I'm assuming you have a structure like this:

    tblEmployees (with a supervisor flag)
    tblEmployeeAssignments (stores the employee ID of the supervisor and the employee ID of the supervisee)

    Your first combo box would be a list of any person on tblEmployees that had the supervisor flag marked (a YES/NO field would work fine)
    Your second box could contain the list of employees that belong to that supervisor AND the list of unassigned employees by creating a query where you are selecting all NON supervisors from tblEmployees linking it to the tblEmployeeAssignments going from the EMPLOYEEID of tblEmployees to the EMPLOYEEID of the supervisee. Then in the criteria of the EMPLOYEEID from tblEmployeeAssignments you would have IS NULL. Then go down one row in your criteria section and put a criteria under the SUPERVISORID from tblEmployeeAssignments you would have =[forms]![yourformname]![yoursupervisorcomboboxname].

  5. #5
    nycman is offline Advanced Beginner
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    31
    I think I understand what are you saying. But what does "flag" means?

    thank you so much

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    by a flag I mean something like a YES/NO field where if the person is a supervisor it's set to YES so you can identify different tiers of employees (you could even have a 'rank' field with a foreign key to a hierarchy table with different ranks like 'CEO, VP, District Manager, Group manager, etc)

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

Similar Threads

  1. how i make a query on combobox selction
    By eldarbs in forum Queries
    Replies: 16
    Last Post: 09-21-2012, 05:50 PM
  2. Replies: 1
    Last Post: 09-07-2012, 10:48 AM
  3. Replies: 11
    Last Post: 03-29-2012, 02:32 PM
  4. Reports list disappear in combo box.
    By cap.zadi in forum Forms
    Replies: 4
    Last Post: 01-04-2012, 09:26 AM
  5. How to make A combobox run a query?
    By UnrealEnvy in forum Access
    Replies: 8
    Last Post: 08-17-2009, 11:28 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