locked
Row Source query not updating RRS feed

  • Question

  • I'm using an unbound form, with a subform.  Control 1 of the main form is a combo box, showing the primary key of Table T.  Table S has a Dual field primary key, with one field being the primary key of table T.  Control 2 is a combo box that shows all instances of the secondary field in table S, where a PK from Table T has been selected in Combo 1.

    As Control 1 is selected, the recordsource for my sub form is updated, to grabbing all instances of of Table X where Control 1 exists.

    As Control 2 is additionally selected, the recordsource for my sub form is updated to grabbing all instances in Table X where Control 1 AND control 2 exists.

    Everything is working fine, except, for a row source for a combo box in the sub form that is not updating.  I want the combo box in the sub form to display the same options as Control 2's combo box.  I'm using the same query, but strangely, if I go back and make a different selection for Control 1, the row source for my subform combo box remains the same.  If I click a record in the subform and click refresh, the combo box is updated.  I find this strange, because every time I make any changes to Control 1 or 2, the subform is refreshing with a new recordsource, why isn't the row source updating too?  Is there a way I can pinpoint a refresh of the combo box control in my subform giving me the issue?

    Thursday, March 8, 2012 9:02 PM

Answers

  • Try a Requery of the combo box on the subform in the On Current event of the subform.

    Regards, Hans Vogelaar

    • Proposed as answer by -suzyQ Thursday, March 8, 2012 11:29 PM
    • Marked as answer by w85 Friday, March 9, 2012 3:23 PM
    Thursday, March 8, 2012 9:32 PM

All replies

  • Try a Requery of the combo box on the subform in the On Current event of the subform.

    Regards, Hans Vogelaar

    • Proposed as answer by -suzyQ Thursday, March 8, 2012 11:29 PM
    • Marked as answer by w85 Friday, March 9, 2012 3:23 PM
    Thursday, March 8, 2012 9:32 PM
  • That did it!

    Thank you, this was driving me crazy.

    Friday, March 9, 2012 3:23 PM