cascading combo box in datasheet

  • Thread starter Thread starter Rod Barr
  • Start date Start date
R

Rod Barr

Guest
I have a sub form as a datasheet with multiple combo boxes. As one is chosen it drives what is in the next combo box. The data stores properly in the tables, but the view of the other rows goes blank when I choose something different in the next row's cbo box.

HELP!
 
This is caused by your cascading combo restricting the data display.

I suspect that you have a criteria statement in the rowsource of your second combo that specifies the value of the first. Making a selection in the first will then requery the second. yeah??


If so, remove the criteria statement, and rather than requerying after selection of the first, specify the Row Source using SQL

eg:

Code:
 Me.SecondCombo.RowSource = "SELECT SomeID,SomeInfo FROM" & _
   " tbl_SomeTable WHERE SecondComboID = " & Me.SecondComboID & _
   " ORDER BY SomeInfo"

This should enable you to have existing records display correctly but still cascade your combo boxes on the active record.

HTH

Brad.
 
Thanks Brad
I think I did as you suggested. I was originally refreshing the RowSource of the 2nd cbo box in the After Update Event of the first cbo box. It works, but the other rows go blank on the requery
Now I put very similar code to your suggested code into the second cbo box's RowSource area in the Properties Window, but it doesn't work.

Any other ideas would be of great help
 
Last edited:
I'm half way (I think)

I tried taking the row source SQL statement out of the row source in the properties window and put it in the On Current Event of the Form. This showed me that the code is correct, but you need to take the focus off of that row and then go back to it for the second cbo box to be loaded.

HELP Again!

Rod
 
Last edited:

Users who are viewing this thread

Back
Top Bottom