Hi,
I have a triple cascading combo box setup that works completely fine. The trouble I’m having is getting a text box related to the second combo box to autofill based on a selection, and I've spent more than 8 hours trying to figure it out! Here's the senario:
The user selects a Class description from the first combo box, and the text box next to it autofills perfectly with a related value (from a row source sql query).
Then the user selects a ClassSeries from the second combo box, and the text box next that combo box is supposed autofill with a value (from a diferent row source sql query) related to the second combo box, but it doesn’t. This is where I need help.
Here is my After Event coding:
Private Sub cboClassID_AfterUpdate()
Me.cboClassSeriesID.RowSource = "SELECT [UFS-ClassSeries].SeriesID, [UFS-ClassSeries].SeriesDescrip FROM [UFS-ClassSeries] " & _
" WHERE ClassID = " & Nz(Me.cboClassID) & _
" ORDER BY SeriesDescrip"
Me.cboClassSeriesID = Null
Me.Textbox1 = Me.cboClassID.Column(2)
EnableControls
End Sub
Private Sub cboClassSeriesID_AfterUpdate()
Me.cboSubSeriesID.RowSource = "SELECT [UFS-SubSeries].SubSeriesID, [UFS-SubSeries].SubDescrip FROM [UFS-SubSeries] " & _
" WHERE SeriesID = " & Nz(Me.cboClassSeriesID) & _
" ORDER BY SubDescrip"
Me.cboSubSeriesID = Null
Me.Textbox2 = Me.cboClassSeriesID.Column(2)
EnableControls
End Sub
Private Sub EnableControls()
' Clear the combo boxes
If IsNull(Me.cboClassID) Then
Me.cboClassSeriesID = Null
End If
' Enable or disable combo boxes based on whether the combo box preceeding it has a value.
Me.cboClassSeriesID.Enabled = (Not IsNull(Me.cboClassID))
Me.cboSubSeriesID.Enabled = (Not IsNull(Me.cboClassSeriesID))
End Sub
IMPORTANT NOTE: This is the code (included above) that “seems” to be the problem - Me.Textbox2 = Me.cboClassSeriesID.Column(2) The weird thing is if I simply change the (2) to (0) or (1), then the text box is populated accordingly.
I sure hope someone can help!!!!
Dawnit
I have a triple cascading combo box setup that works completely fine. The trouble I’m having is getting a text box related to the second combo box to autofill based on a selection, and I've spent more than 8 hours trying to figure it out! Here's the senario:
The user selects a Class description from the first combo box, and the text box next to it autofills perfectly with a related value (from a row source sql query).
Then the user selects a ClassSeries from the second combo box, and the text box next that combo box is supposed autofill with a value (from a diferent row source sql query) related to the second combo box, but it doesn’t. This is where I need help.
Here is my After Event coding:
Private Sub cboClassID_AfterUpdate()
Me.cboClassSeriesID.RowSource = "SELECT [UFS-ClassSeries].SeriesID, [UFS-ClassSeries].SeriesDescrip FROM [UFS-ClassSeries] " & _
" WHERE ClassID = " & Nz(Me.cboClassID) & _
" ORDER BY SeriesDescrip"
Me.cboClassSeriesID = Null
Me.Textbox1 = Me.cboClassID.Column(2)
EnableControls
End Sub
Private Sub cboClassSeriesID_AfterUpdate()
Me.cboSubSeriesID.RowSource = "SELECT [UFS-SubSeries].SubSeriesID, [UFS-SubSeries].SubDescrip FROM [UFS-SubSeries] " & _
" WHERE SeriesID = " & Nz(Me.cboClassSeriesID) & _
" ORDER BY SubDescrip"
Me.cboSubSeriesID = Null
Me.Textbox2 = Me.cboClassSeriesID.Column(2)
EnableControls
End Sub
Private Sub EnableControls()
' Clear the combo boxes
If IsNull(Me.cboClassID) Then
Me.cboClassSeriesID = Null
End If
' Enable or disable combo boxes based on whether the combo box preceeding it has a value.
Me.cboClassSeriesID.Enabled = (Not IsNull(Me.cboClassID))
Me.cboSubSeriesID.Enabled = (Not IsNull(Me.cboClassSeriesID))
End Sub
IMPORTANT NOTE: This is the code (included above) that “seems” to be the problem - Me.Textbox2 = Me.cboClassSeriesID.Column(2) The weird thing is if I simply change the (2) to (0) or (1), then the text box is populated accordingly.
I sure hope someone can help!!!!
Dawnit