Consulting

Results 1 to 3 of 3

Thread: Populating Critirea From A Combo Box

  1. #1

    Populating Critirea From A Combo Box

    Morning All,

    I have created a form that displays records depending on the employee name that is selected from 'Employee Name' combo box, I now need to add an additional combo box called 'Department' that will select a department i.e finanace and then display only the employee's that come under 'finance' in the 'Employee Name' combo box.

    Any idea's would be appriecated.

    Cheers,

    Mattster

  2. #2
    VBAX Master CreganTur's Avatar
    Joined
    Jan 2008
    Location
    Greensboro, NC
    Posts
    1,676
    Location
    How you handle this really depends on how your form is designed.

    If the EmployeeName and Department comboboxes are part of a login screen that you use to open the record-displaying form then you can use the value of both comboboxes as part of the WHERE Condition of the DoCmd.OpenForm method.

    If both comboboxes are on the record displaying form, then you can look into setting the form's recordsource via VBA and reference the combobox values as the WHERE part of the SQL statement. search for RecordSource Property in VBA help in Access.
    -Randy Shea
    I'm a programmer, but I'm also pro-grammar!
    If your issue is resolved, please use Thread Tools to mark your thread as Solved!

    PODA (Professional Office Developers Association) | Certifiable | MOS: Access 2003


  3. #3
    VBAX Mentor
    Joined
    Aug 2008
    Posts
    323
    Location
    @ Randy you really are a Pro-Gramar
    As randy said if you have both the combo boxes in the login screen, have the combo box of departments to list a all the departments, then the employee combox should be based on a query with the where condition being the value of the department combobox , so that it would populate only the list of employees in that particular department. and the form would show the information for that particular employee.
    ( I am assuming that a employee works in one single department )
    I am a Newbie, soon to be a Guru

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •