More on Cascading Combo Boxes.

G

Guest

I thought I had the answer, but I was wrong.
Can anyone tell me why this doesn't work?

Private Sub Combo317_AfterUpdate()
On Error Resume Next
Select Case Combo317.Value
Case "Canso"
Combo319.RowSource = "tblProdCanso"
Case "Laguna"
Combo319.RowSource = "tblProdLaguna"
Case "Richmond"
Combo319.RowSource = "tblProdRichmond"
Case "Sysco"
Combo319.RowSource = "tblProdSysco"
End Select

End Sub

It's supposed to base the product selection available in combo box 319 on
the manufacturer chosen in combo box 317.
 
W

Wayne Morgan

Your table structure is not what would be called "normalized", but that
doesn't appear to be the problem here. You are using the Value of Combo327
to pick the RowSource for Combo319. How many columns are in Combo317? If
more than one, be aware that the Value comes from the BoundColumn, which is
probably NOT the displayed column. You can either change Value to the
correct column or you can change the Case statements to the value in the
BoundColumn.

Example:
Select Case Combo317.Column(1)

The Column index is zero based, so 1 would be the second column.
 
G

Guest

Hi Gee.

What is the value of the Bound Column for Combo317? It is possible that it
is passing in a value, such as a primary key, that is hidden in the combo box
but is still available.

When you place a breakpoint on the "Select Case Combo317.Value" line and
step through it, what is the value of Combo317?

Lance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top