Multiple combo box in continuous form.

drpkrupa

Registered User.
Local time
Today, 08:53
Joined
Jun 1, 2009
Messages
13
I have continuous form as sub form. This sub form has two combo box.
1) Defect Type
2) Defect Code

The defect code based on defect type. This is what i want to do.
When user select value from first combo box which is defect type then i want to rebind the defect code combo box.

I have done this so far.
1) create first combo box and bind the value from table called defect type.
2) Create secpmd combo box and bind the value from table called defect code and add where cause defect type = forms1subform!cmbdefecttype
3) added code on change for first combo box.
cmbDefCode.Requery

This works but update value for all rows insted on that specific row. If i have four line for sub form and if i select one defect type then insted on change defect code value for that line it change for all four line. How can i only change defect code value for only current row not all rows.

Thanks
 
Drpkrupa,

Remove the Requery code, and also remove the WHERE clause from the 2nd combobox's Row Source query.

On the Enter event of the defect code combobox, enter code like this:
Me.cmbDefCode.RowSource = "SELECT blabla FROM YourTable WHERE DefType = " & Me.cmbDefectType

... and then on its Exit event:
Me.cmbDefCode.RowSource = "SELECT blabla FROM YourTable"
 
You can't really cascade combos on a contiuous subform very effectively. If you look at your subform in design view there is only one set of controls on a single detail section of the form, and if you change the property of a control all instances of that combo are changed. And since a combo can only display data that appears in its rowsource, this can make data appear to disappear.
This can make users get really cranky.
 

Users who are viewing this thread

Back
Top Bottom