I suppose you can not do it when you use Forms native master-detail processing: child query should be in context of parent one. You should implement your own logic. Unfortunately ON-POPULATE-DETAILS doesn't fire if no relations exist, so you should use WHEN-NEW-RECORD-INSTANCE or some other similar trigger.
Regards, Dima