Results 1 to 2 of 2
  1. #1
    cbrxxrider is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Location
    Central NY
    Posts
    16

    Question combo box listing all employees or only ones in certain departments

    I have two combo boxes. one lists all departments and one is bound to the department combo box. So when any certain department is chosen, it only shows the employees within that department.

    My employee combo box row source is -



    SELECT Employee.EmployeeID, Employee.[First Name], Employee.[Last Name] FROM Department INNER JOIN Employee ON Department.Department = Employee.Department WHERE (((Employee.[Manager/Supervisor])=No) And ((Department.Department)=Forms!CompletedGoalForm!D epartment)) Or (((Department.Department)="all")) ORDER BY Employee.[First Name];

    I'm pretty sure I'm just missing something small here but I need to put an OR All or something in here somewhere so that when the department combo is left alone and no department is chosen, all the employees will be listed in the employee combo box.

  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,921
    Use LIKE operator and wildcard:

    SELECT Employee.EmployeeID, Employee.[First Name], Employee.[Last Name] FROM Department INNER JOIN Employee ON Department.Department = Employee.Department WHERE Employee.[Manager/Supervisor]=No And Department.Department LIKE Forms!CompletedGoalForm!Department & "*" ORDER BY Employee.[First Name];
    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. Listing fields
    By geraldk in forum Queries
    Replies: 19
    Last Post: 04-17-2012, 01:49 PM
  2. Replies: 3
    Last Post: 03-23-2012, 06:16 AM
  3. Replies: 10
    Last Post: 03-02-2012, 11:06 AM
  4. Merging/linking two legacy tables from different departments
    By jhollingsh615 in forum Database Design
    Replies: 14
    Last Post: 04-07-2011, 11:06 AM
  5. One to Many Listing in Forms
    By zunebuggy in forum Forms
    Replies: 5
    Last Post: 05-11-2010, 08:12 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