Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    34

    Unanswered: View records on a form with cascading combo boxes

    I have a small form called Pick_Buyer; the user selects a buyer's name (an invisible BuyerID) from a combo box. They then hit an [OK] button, which closes Pick_Buyer, opens up a form called Buyer_Profile_Form, and shows all the information associated with the BuyerID. Nice and easy, works fine, except for one thing.

    Within the Buyer_Profile_Form are two combos called BrokerageID and AgentID; AgentID is dependant upon BrokerageID, since the agents would naturally be associated with companies. Those boxes work fine when I enter or edit data. However, when I call up a record from Pick_Buyer, AgentID comes up blank. How can I "tell" AgentID combo what's going on?


    The Row Source Property for AgentID is:

    SELECT Broker_Agents.AgentID, Broker_Agents.FirstName & " " & Broker_Agents.LastName AS Expr1, Broker_Agents.BrokerageID
    FROM Broker_Agents
    WHERE (((Broker_Agents.BrokerageID)=[Forms]![Buyer_Profile_Form]![BrokerageID]))
    ORDER BY Broker_Agents.LastName, Broker_Agents.FirstName;

    And here is the relevant code in Buyer_Profile:

    Private Sub AgentID_GotFocus()
    If (BrokerageID.ListIndex < 0) Then
    MsgBox "Please specify a brokerage first"
    BrokerageID.SetFocus
    Else
    AgentID.Requery
    End If
    End Sub

    Private Sub BrokerageID_AfterUpdate()
    AgentID.Requery
    End Sub

  2. #2
    Join Date
    Oct 2003
    Posts
    34
    If I set up Buyer_Profile_Form to close whenever I hit the "Pick a new buyer" button (which opens Pick_Buyer), that seems to solve the problem. It's simply having the large form open and the small one at the same time that seems to give it a headache.

    Still, any alternate solutions would be appreciated...

Posting Permissions

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