J
jahoff3 via AccessMonster.com
I am trying to create a form that feeds off of one query. There are two
combo boxes, and depending the options selected, results are listed in a list
box below. I have the following Code setup, however, nothing happens on my
form. I am new at this, so if additional information is needed, please let
me know.
Option Compare Database
Option Explicit
Const strSQL1 = "SELECT Collection.Analyst, Analyst.Extension, Collection.
Manager, Manager.Extension " & "FROM qryCombo1 WHERE Territory = "
Const strSQL2 = " AND Broker = "
Private strSQL As String
Const strMsg1 = "Select a territory from the list"
Const strMsg2 = "Select a broker from the list"
Private Sub cboTerritory_AfterUpdate()
If Me!cboBroker.Value > 0 Then Call FillList
End Sub
Private Sub cboBroker_AfterUpdate()
If Me!cboTerritory.Value <> " " Then Call FillList
End Sub
Private Sub cboStatus_AfterUpdate()
End Sub
Private Sub FillList()
strSQL = strSQL1 & Me!cboTerritory.Value & strSQL2 & Me!cboBroker.Value
Me!lblList.RowSource = strSQL
Me!lblList.Requery
End Sub
Private Sub Form_Activate()
If Me!cboTerritory.Value <> " " And Me!cboBroker.Value > 0 Then Call FillList
End Sub
combo boxes, and depending the options selected, results are listed in a list
box below. I have the following Code setup, however, nothing happens on my
form. I am new at this, so if additional information is needed, please let
me know.
Option Compare Database
Option Explicit
Const strSQL1 = "SELECT Collection.Analyst, Analyst.Extension, Collection.
Manager, Manager.Extension " & "FROM qryCombo1 WHERE Territory = "
Const strSQL2 = " AND Broker = "
Private strSQL As String
Const strMsg1 = "Select a territory from the list"
Const strMsg2 = "Select a broker from the list"
Private Sub cboTerritory_AfterUpdate()
If Me!cboBroker.Value > 0 Then Call FillList
End Sub
Private Sub cboBroker_AfterUpdate()
If Me!cboTerritory.Value <> " " Then Call FillList
End Sub
Private Sub cboStatus_AfterUpdate()
End Sub
Private Sub FillList()
strSQL = strSQL1 & Me!cboTerritory.Value & strSQL2 & Me!cboBroker.Value
Me!lblList.RowSource = strSQL
Me!lblList.Requery
End Sub
Private Sub Form_Activate()
If Me!cboTerritory.Value <> " " And Me!cboBroker.Value > 0 Then Call FillList
End Sub