Was playing around with cascading comboboxes and when I entered the last box with data and ran the afterupdate event, all the comboboxes blanked out. The results that the comboboxes provided did show up though. cbo1-cbo4 are shorthand for the actual name of the comboboxes.
On open form is unbound
Comboboxes are unbound in header
Textboxes in detail are unbound
After update cbo1 provides row source for cbo2
After update cbo2 provides row source for cbo3
After update cbo3 provides row source for cbo4
After update cbo4 sets the recordsource of the form to an SQL statement and adds a where clause using the values from the comboboxes.
Form displays the results correctly of the recordsource in textboxes where the field (control source) is determined by the value in cbo2 (tablename) --and then the values in the combobox disappear (in stepping though code, i see that the value of the cbo is null so more than disappearing, it is wiping out what was there)
Before this behavior, the comboboxes maintained the value and I could then choose another item from one of the cascaded boxes to view another record's data. Not sure what changes in the code is causing this "reset". I don't have any requery or refresh statements so have ruled that out as a cause.
I did a search and found a suggestion that had the value from the combo be put in a textbox. Tried that, but that also got cleared out on the final combo box's afterupdate event.
Do I need to use a form/subform approach rather than header/detail? I can proved the code if needed.
On open form is unbound
Comboboxes are unbound in header
Textboxes in detail are unbound
After update cbo1 provides row source for cbo2
After update cbo2 provides row source for cbo3
After update cbo3 provides row source for cbo4
After update cbo4 sets the recordsource of the form to an SQL statement and adds a where clause using the values from the comboboxes.
Form displays the results correctly of the recordsource in textboxes where the field (control source) is determined by the value in cbo2 (tablename) --and then the values in the combobox disappear (in stepping though code, i see that the value of the cbo is null so more than disappearing, it is wiping out what was there)
Before this behavior, the comboboxes maintained the value and I could then choose another item from one of the cascaded boxes to view another record's data. Not sure what changes in the code is causing this "reset". I don't have any requery or refresh statements so have ruled that out as a cause.
I did a search and found a suggestion that had the value from the combo be put in a textbox. Tried that, but that also got cleared out on the final combo box's afterupdate event.
Do I need to use a form/subform approach rather than header/detail? I can proved the code if needed.