Cascading Combo Box - Rest-

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kcdoell
    New Member
    • Dec 2007
    • 230

    Cascading Combo Box - Rest-

    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.
  • kcdoell
    New Member
    • Dec 2007
    • 230

    #2
    Hello:

    Basically, what I am trying to do is make sure that the selections that they have selected is one of my Unique "LocationID s" in my tblLocationsMM. Right now they are able to move forward to the next form even though the LocationID does not exists.

    What would be the best approach for preventing this scenario?

    Thanks,

    Keith.

    Comment

    • kcdoell
      New Member
      • Dec 2007
      • 230

      #3
      Okay I solved this one, no need to reply....

      Comment

      Working...