Cascading Combo Boxes on continuos form (1 Viewer)

vbbbmom

Registered User.
Local time
Today, 17:02
Joined
Jul 12, 2011
Messages
33
I have a continuous form that has 2 combo boxes, I choose a selection in the first combo box and the 2nd combo box offers me options related to my selection in the first one. This works great, until I move to the next line, and it requeries the 2nd combo box based off of my new selection and my previous entry is changed to the new selection? not sure how to requery the 2nd combo box on a continuous form.
 

missinglinq

AWF VIP
Local time
Today, 17:02
Joined
Jun 20, 2003
Messages
6,423
All instances of an Unbound Control on a Continuous or Datasheet View Form display the data last entered into any instance (on any Record) of the Control.

This means if your 2nd_Combobox is Unbound, and you select, say, "OptionB" from 2nd_Combobox, "OptionB" will be selected in 2nd_Combobox on All Records!

If you go to another Record and select "OptionA," "OptionA" will now show in 2nd_Combobox on All Records!

To keep the selection in 2nd_Combobox appropriate for each Record, you have to Bind the 2nd_Combobox Control to a Field in the underlying Table.

Linq ;0)>
 

vbbbmom

Registered User.
Local time
Today, 17:02
Joined
Jul 12, 2011
Messages
33
OK, I tried to bind the 2nd combo box but I want the description to be visible in the field even though the ID is the stored value, I wasnot able to get this to work. Can you explain how you bind the 2nd combo box Please! I feel like I should know this already.
 

Beetle

Duly Registered Boozer
Local time
Today, 15:02
Joined
Apr 30, 2011
Messages
1,808
The trick to this is adding a text box to your form that is bound to the field in the record set that you want to display. For example, suppose your record set is a query that includes an EmployeeID field and the second combo box on your form is bound to this field, but displays the EmployeeName via it's Row Source. You would add the EmployeeName field to the record set, then add a text box on your form that is bound to the EmployeeName field. You then size this text box so that it is the same height and width of the second combo box, minus the width of the drop down button itself. Place the text box on top of the combo box so that it appears to be part of the combo box. Set the locked property of the text box to Yes so the users cannot alter the value in this field.

If you download the Continuous Combo sample file from the link that vbaInet provided you can see this in action.
 

Users who are viewing this thread

Top Bottom