• Setting record source on subform

    Author
    Topic
    #500409

    Hi,I have a main form/subform situation where I am using two combo boxes on the main form to establish query parameters, in which once selected the second combo box triggers a “make Table” query which is used for the subforms record source. However I am running into a problem with the VBA code setting the record source. I am attempting to use “Forms![frm_subsafe_report_criter_selection]![subfrm_unauthorized_subsafe].Form.RecordSource = “tbl_Make_Table_Unauthorized_Subsafe”” to set the record source of the subform using an after update event on the second combo box on the main form. This generates an error and Access tells me it can’t find the field “subfrm_unauthorized_subsafe”, which in this case is actually the subform… I can’t tell whats wrong in the VBA statement causing this. Can someone direct me on the right path ? PS: i have also tried “Me![subfrm_unauthorized_subsafe].Form.RecordSource = “tbl_Make_Table_Unauthorized_Subsafe”” which also generates the same errorthank you

    Viewing 0 reply threads
    Author
    Replies
    • #1509316

      I think this tip from Allen Browne will help you out. The “Form” must always precede the name of the subform. Also note that the reference should be to the name of the subform control on the main form, not the subform name.

    Viewing 0 reply threads
    Reply To: Setting record source on subform

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: