Hi All-
I have a table (tblExample) set up that is something like this...
Main Secondary Tertiary
A 1 a
A 1 b
A 1 c
A 2 a
A 2 b
A 2 c
B 3 a
B 3 b
B 3 c
I set up a three combo boxes on a form. The combo boxes are based on that table. I'll call them cboMain, cboSecondary, cboTertiary
I was able to make them cascade (so in other words, if the user chooses "A" for the cboMain, they have choices 1 and 2) by using the following:
Code:
Private Sub cboMain_AfterUpdate()
Dim strSource As String
strSource = "SELECT cboSecondary " & _
"FROM tblExample" & _
"WHERE Main = '" & Me.cboMain & "' ORDER BY Secondary"
Me.cboSecondary.RowSource = strSource
Me.cboSecondary = vbNullString
End Sub
The issue I'm having is that instead of just returning choices 1 and 2 for cboSecondary, I get choices 1,1,1,2,2,2
Is there a line of code or something I can plug in where it will force a "Group By" of the results?
Any help would be appreciated. Thank you!