How to open form based on combo box data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Smecker
    New Member
    • Oct 2011
    • 11

    #1

    How to open form based on combo box data

    I'm working on a database that contains managers, users, and user accounts on an application. I have a form (frmManagers) that has a combo box that populates with the names of the managers. I've created another form (frmUsers) that lists user information (name, email, department, etc.) that has a subform that lists all the accounts the user has on a particular application.

    I would like to be able to have a manager go to frmManagers, find their name in the dropdown and click a button which will open up frmUsers and show only that particular manager's users. Basically I want to pass the combobox value to a WHERE clause on the users form, but I'm not sure how to do that. Can anybody help me out?
  • Smecker
    New Member
    • Oct 2011
    • 11

    #2
    Nevermind, I think I got it figured out. Built a Where string to put in the DoCmd.Openform command.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      Indeed. The WhereCondition parameter of the DoCmd.OpenForm( ) method is what you need to use to specify the filtering.

      Comment

      Working...