According to the article you've linked, you have to create a view and point the record source to that view. Since you don't show the source code, or elaborate on what you mean by "dynamically", then the best suggestion would be to create the view in a ON INSERT, UPDATE trigger in SQL database.
- ON INSERT, UPDATE trigger on the main table.
- Generate the dynamic view you need for the subform giving the view a standard name like vwSubForm[PKID] where [PKID] is the primary key for the row.
- Edit your dynamic record source code to point to the generated view for the subform.