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

    Filtering employee id with query on a form

    Hi i'm having trouble filtering a subform by employeeID.

    I have a form that has a unbound combobox that uses a row source of SELECT Employees.EmployeeID, [FirstName] & ", " & [LastName] AS Expr1 FROM Employees;
    i have a subform called "Jobs Query4 subform" with a record source of "Jobs Query4" which has the field "EmployeeID" from "Orders" table
    When i select the employee's name in the combobox the subform is filtered by the employee i select, and seems to work fine.
    The problem i have is, if i select the employee with a employeeID of 1 then if any other employee with an ID of 10 to 19 is used in the continuous form also, they will show up when i only want employee with EmployeeID of 1 to show.
    The employeeID is the key feild with a auto number from "employees" table.


    Is there a way i could filter the query with criteria, or is it a auto number issue, that if i go over 20 employees, when i select id of 2 that ids 20 to 29 will show up also etc.

    Form Layout:
    I have a form (Daily Jobs) with a subform (Jobs Query4 subform).
    I have a combo box (Employee) located on Daily Jobs


    I wish to use (Employee) combo to filter the results of (Jobs Query4 subform)

    any help will be greatly appreciated.

  2. #2
    stylar is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    2
    tried for ages to work this out and i just found the answer

    I put in the Jobs Query4 subform filter property: [EmployeeID]=[Forms]![Daily Jobs]![Employee]
    which filtered the form correctly. if i wanted the filter to work on load i could choose yes in on load option
    But because i wanted to filter based on the combobox selection i used the after update in the combo box to turn the filter on: Me![Jobs Query4 subform].Form.FilterOn = True
    that way when the form loaded i could see all my daily jobs then filter them by employee selection.

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

Similar Threads

  1. Replies: 15
    Last Post: 04-17-2012, 01:42 PM
  2. Replies: 1
    Last Post: 01-08-2012, 06:25 PM
  3. Query (Filtering?) in a Form
    By bobhra in forum Forms
    Replies: 2
    Last Post: 01-09-2011, 02:45 PM
  4. Replies: 1
    Last Post: 10-24-2010, 07:42 PM
  5. Filtering a Query
    By Brian62 in forum Queries
    Replies: 2
    Last Post: 06-03-2010, 01:46 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