J
jahoff3 via AccessMonster.com
I have established three combo boxes. The first box contains territories.
Based off of what territory is selected, the second box is populated with
broker companies. Finally, based off of what broker compnay is selected, the
third box is populated with account information. All of this informaiton is
tied to a collection analyst, analyst extension, collection manager, and
manager extension. I would like the latter to populate into a list box so
our sales rep knows who to contact. Everything seems to be working except
for the list box containing the analyst/manager information. Here is the
code I have setup so far:
Option Compare Database
Option Explicit
Private Const strSQL1 = "SELECT [Collection Analyst], [Analyst Extension],
[Collection Manager], [Manager Extension]" & _
"FROM qryCombo1 WHERE Territory = '"
Private Const strSQL2 = "' AND Broker = "
Private Const strSQL3 = "' AND Status = "
Private strSQL As String
Private Sub cboBroker_Click()
Me!cboStatus = Null
Me!cboStatus.Requery
End Sub
Private Sub cboStatus_Click()
Me!Analyst = Null
Me!Analyst.Requery
End Sub
Private Sub cboTerritory_AfterUpdate()
Call FillList
End Sub
Private Sub cboBroker_AfterUpdate()
Call FillList
End Sub
Private Sub cboStatus_AfterUpdate()
Call FillList
End Sub
Private Sub FillList()
strSQL = strSQL1 & Me!cboTerritory.Value & _
strSQL2 & Me!cboBroker.Value
Me!Analyst.RowSource = strSQL
Me!Analyst.Requery
End Sub
Private Sub cboTerritory_Click()
Me!cboBroker = Null
Me!cboStatus = Null
Me!cboBroker.Requery
Me!cboStatus.Requery
End Sub
Private Sub Form_Activate()
Call FillList
End Sub
Any suggestions on what I am doing wrong or what is missing?
Based off of what territory is selected, the second box is populated with
broker companies. Finally, based off of what broker compnay is selected, the
third box is populated with account information. All of this informaiton is
tied to a collection analyst, analyst extension, collection manager, and
manager extension. I would like the latter to populate into a list box so
our sales rep knows who to contact. Everything seems to be working except
for the list box containing the analyst/manager information. Here is the
code I have setup so far:
Option Compare Database
Option Explicit
Private Const strSQL1 = "SELECT [Collection Analyst], [Analyst Extension],
[Collection Manager], [Manager Extension]" & _
"FROM qryCombo1 WHERE Territory = '"
Private Const strSQL2 = "' AND Broker = "
Private Const strSQL3 = "' AND Status = "
Private strSQL As String
Private Sub cboBroker_Click()
Me!cboStatus = Null
Me!cboStatus.Requery
End Sub
Private Sub cboStatus_Click()
Me!Analyst = Null
Me!Analyst.Requery
End Sub
Private Sub cboTerritory_AfterUpdate()
Call FillList
End Sub
Private Sub cboBroker_AfterUpdate()
Call FillList
End Sub
Private Sub cboStatus_AfterUpdate()
Call FillList
End Sub
Private Sub FillList()
strSQL = strSQL1 & Me!cboTerritory.Value & _
strSQL2 & Me!cboBroker.Value
Me!Analyst.RowSource = strSQL
Me!Analyst.Requery
End Sub
Private Sub cboTerritory_Click()
Me!cboBroker = Null
Me!cboStatus = Null
Me!cboBroker.Requery
Me!cboStatus.Requery
End Sub
Private Sub Form_Activate()
Call FillList
End Sub
Any suggestions on what I am doing wrong or what is missing?