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
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"
Private Sub BrokerageID_AfterUpdate()
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...