locked
Set default Values in a Sub Form, baised on the Parent Form and Filter the Results shown in the Subform RRS feed

  • Question

  • Hi All,

    I have a Form which records ORDER details, and then in this from I have a sub form that records ITEMS ordered. The order details are from a table, and the items ordered are from a query. Is there a way that, when a new order is created, the subform data is then filtered by the new ORDER NUMBER which is used to link the fields?

    Then is it also possible in the Subform, to set the ORDER NUMBER to = the new ORDER NUMBER that has just been created in the main part of the form?

    Thanks

    Tom

    Thursday, February 16, 2012 12:54 PM

Answers

  • If you specify ORDER NUMBER in the Link Master Fields and Link Child Fields property of the subform, Access will handle it all for you.

    Regards, Hans Vogelaar

    • Marked as answer by t0m46 Thursday, February 16, 2012 8:09 PM
    Thursday, February 16, 2012 1:01 PM

All replies

  • If you specify ORDER NUMBER in the Link Master Fields and Link Child Fields property of the subform, Access will handle it all for you.

    Regards, Hans Vogelaar

    • Marked as answer by t0m46 Thursday, February 16, 2012 8:09 PM
    Thursday, February 16, 2012 1:01 PM
  • Hans Vogelaar [MVP] wrote:

    If you specify ORDER NUMBER in the Link Master Fields and Link Child
    Fields property of the subform, Access will handle it all for you.

    Correct. And if for some reason you can't use this link fields you may use the Form_BeforeInsert (or Form_BeforeUpdate) event to grab the values from the parent controls and write these to the child record.

    HTH
    Henry

    Monday, February 20, 2012 9:06 AM