Change a subform's recordsource from another subform in Access

Posted by Dkellygb on Stack Overflow See other posts from Stack Overflow or by Dkellygb
Published on 2010-03-20T16:46:07Z Indexed on 2010/03/20 16:51 UTC
Read the original article Hit count: 404

Filed under:
|

I am using MS Access 2003 and I have a form with two subforms (subform1 and subform2) which are not nested. They both display tabular data on them so they cannot be nested. I would like to change the recordsource on subform2 based on a value in the current record on subform1.

I have tried to put the code in the oncurrent event of subform1 but I cannot seem to refer to the recordsource in subform2 from subform1. From subform1 I have tried me.parent!subform2.form.recordsource but I get a runtime error ‘2455’ You have entered an expression that has an invalid reference to the property form/report.

Any ideas?

© Stack Overflow or respective owner

Related posts about access

Related posts about subforms