Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Posts
    11

    Question Unanswered: Display records based off a combobox selection

    I have a form that has two comboboxes, cboTeamName and cboAgentName. I've managed to filter cboAgentName based off cboTeamName selection, so I guess my question is, how do I only display the records for the cboAgentName selection? :confused:


    My Tables

    tblTeams
    (Not displayed on the form)
    TeamID
    TeamName

    tblAgents
    (These fields are displayed on the form)
    AgentID
    AgentName
    TeamID
    nACDInts
    nOutInts
    nCustSat

  2. #2
    Join Date
    Apr 2003
    Posts
    280
    display to what?

  3. #3
    Join Date
    Jun 2004
    Posts
    11
    For example:

    On Team1 there is AgentBob, AgentSteve, and AgentMike
    On Team2 there is AgentJoe, AgentFred, and AgentTom

    If I select Team2 from cboTeamName, I will only be able to select AgentJoe, AgentFred, and AgentTom from cboAgentName. Now if I select AgentTom from cboAgentName, I only want to see the records (tblAgents.nACDInts, tblAgents.nOutInts, and tblAgents.nCustSat) for AgentTom on my form.

  4. #4
    Join Date
    Apr 2003
    Posts
    280
    Quote Originally Posted by ktruj0503
    For example:

    On Team1 there is AgentBob, AgentSteve, and AgentMike
    On Team2 there is AgentJoe, AgentFred, and AgentTom

    If I select Team2 from cboTeamName, I will only be able to select AgentJoe, AgentFred, and AgentTom from cboAgentName. Now if I select AgentTom from cboAgentName, I only want to see the records (tblAgents.nACDInts, tblAgents.nOutInts, and tblAgents.nCustSat) for AgentTom on my form.
    example to a listbox or combo box:
    AgentID AgentName
    1 AgentTom
    2 AgentJoe
    3 AgentFred

    listbox name = lstagents
    combo box name = cboagents

    lstagents.RowSourceType = "Table/Query"

    lstagents.RowSource = "Select tblAgents.nACDInts, tblAgents.nOutInts, tblAgents.nCustSat From tblAgents Where AgentID = '" & cboAgents & "' "

    lstagents.requery

  5. #5
    Join Date
    Jun 2004
    Posts
    11
    and if I want tblAgents.nACDInts, tblAgents.nOutInts, tblAgents.nCustSat in individual text boxes rather than a list or combobox?

Posting Permissions

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