Question : How do I filter a combo box based on another combo box in a subform?

I am trying to filter a combo box (Scheme) in a subform (Areas Required) based on another combo box (Area). However on the After Update event on the Area combo box I run a macro which requeries the form. However, it resets the recordset, all previous values entered in scheme are cleared. I need to requery the current record only, or is there an alternative method?

When the user chooses an Area (for example Pontypool, Newport or Cardiff) I want the second combo box (Scheme) to only show schemes in that area. The user selects 3 areas and the 3 prefered schemes.

Many thanks
Gareth

Answer : How do I filter a combo box based on another combo box in a subform?

Within a form  (NOT a record), a combo box can only have one rowsource at any point in time.

If you change the rowsource as you move from record to record then you change it for the whole form.
If values in other records are not now part of the rowsource data, the records will display nothing in the combo box.
The underlying records are not affected, only what gets displayed.

A common solution to this issue is to use two controls, a combo box for selection and a textbox to display the selected/stored value.
It is sometimes possible to lay these one on top of the other so that you can see the arrow for the combo but it is the textbox that is displaying the value. You can adjust the transparency settings of the combo and use the format command to send to back/bring to front to achieve this.
Random Solutions  
 
programming4us programming4us