Link to home
Start Free TrialLog in
Avatar of Paul McCabe
Paul McCabe

asked on

Are cascading combo boxes on a continuous form possible ?

Hello,

This would seem to be a very simple problem, but I have spent hours on it with no success:

I have a continuous form (as a subform), with entered data populating a table. The continuous form has two combo box fields, “Company” and “Employee”, and I am filtering the query underlying the “Employee” combo box with the value of the “Company” Box. This part is working fine (when I click on the “Employee” combo box, I get the correct list of employees associated with the selected company, and the selected employees are being correctly entered into the table)

I also have some associated VBA code as indicated below.

The problem is that despite the underlying table data being  correct, employee names erratically appear or disappear from the continuous form Employee combo box field. For example if I click on the “Employee” combo box in a particular record, the employee names disappear from the other records, or if I close the form and re-open it, only a few of the records display the underlying Employee. For some reason when I remove the company filter from the “Employee” combo box, Employees in all records display stably. Of course this means that employees from all companies are now listed in the combo box selection, rendering it a non-viable solution.

Give all of this, I wonder if it is even possible to do what I am attempting on a continuous form ? I do this sort of thing on single forms all the time with no problems. Any ideas or suggestions would be very welcome. Thank you !

VBA Code:
Private Sub Form_Current()
EmployeeCombo.Requery
End Sub

Private Sub CompanyCombo_AfterUpdate()
EmployeeCombo.Requery
End Sub
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

yes, it is possible. I have done this in some of my projects
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paul McCabe
Paul McCabe

ASKER

The file you attached described the probem very clearly and the solution worked perfectly (yes, I am using continuous view). Excellent. Thank you so much !!!
Glad you found it useful.  Conditional formatting solves certain problems regarding control properties in continuous and data sheet forms but not the problem with cascading combos.