I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:
Expand|Select|Wrap|Line Numbers
- Private Sub CboDivision_AfterUpdate()
- 'When the Division is selected, the appropriate Segment list will
- 'display in the drop down list of CboSegment
- With Me![cboSegment]
- If IsNull(Me!cboDivision) Then
- .RowSource = ""
- Else
- .RowSource = "SELECT DISTINCT tblSegment.SegmentID, " & _
- "tblSegment.SegmentName " & _
- "FROM TblLocationsMM INNER JOIN tblSegment " & _
- "ON TblLocationsMM.SegmentIDFK = tblSegment.SegmentID " & _
- "WHERE [DivisionIDFK]=" & Me!cboDivision
- End If
- Call .Requery
- 'Have the first dropdown list of cboSegment visible
- If Me![cboSegment].ListCount > 0 Then
- Me![cboSegment] = Me![cboSegment].Column(0, 0)
- End If
- End With
- End Sub
The combo box names on the form are the following:
cboDivision
cboSegment
cboWrkReg
cboCreditReg
cboBrokerType
Can anyone help me with the code?
Thanks,
Keith.