Hello:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:
[code=vb]
Private Sub CboDivision_Aft erUpdate()
'When the Division is selected, the appropriate Segment list will
'display in the drop down list of CboSegment
With Me![cboSegment]
If IsNull(Me!cboDi vision) Then
.RowSource = ""
Else
.RowSource = "SELECT DISTINCT tblSegment.Segm entID, " & _
"tblSegment.Seg mentName " & _
"FROM TblLocationsMM INNER JOIN tblSegment " & _
"ON TblLocationsMM. SegmentIDFK = tblSegment.Segm entID " & _
"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 [/code]
What I now trying to do is clear out any selections that have been made if the previous one has been changed...
The combo box names on the form are the following:
cboDivision
cboSegment
cboWrkReg
cboCreditReg
cboBrokerType
Can anyone help me with the code?
Thanks,
Keith.
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box:
[code=vb]
Private Sub CboDivision_Aft erUpdate()
'When the Division is selected, the appropriate Segment list will
'display in the drop down list of CboSegment
With Me![cboSegment]
If IsNull(Me!cboDi vision) Then
.RowSource = ""
Else
.RowSource = "SELECT DISTINCT tblSegment.Segm entID, " & _
"tblSegment.Seg mentName " & _
"FROM TblLocationsMM INNER JOIN tblSegment " & _
"ON TblLocationsMM. SegmentIDFK = tblSegment.Segm entID " & _
"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 [/code]
What I now trying to do is clear out any selections that have been made if the previous one has been changed...
The combo box names on the form are the following:
cboDivision
cboSegment
cboWrkReg
cboCreditReg
cboBrokerType
Can anyone help me with the code?
Thanks,
Keith.
Comment