Fetch record in Subform with criteria

Fetch record in Subform with criteria

How to fetch record in Subform with criteria in script?

I try same with fetch record in Form, but not working:

x = From[ID = 0001];
for each x.Subform[Active == true]
{
}
---have error

x = From[ID = 0001].Subform;
for each x[Active == true]
{
}
---have error  Criteria cannot be applied over fetch object