Subforms in 4D 2004 work in such a way that the current record is unloaded if the subform is redrawn in any way by the OS (e.g. the subform loses focus).
There are two techniques that may be used to get the selected records regardless of whether or not the current record is loaded:
If the subform is set to selection mode multiple, you can use the command GET HIGHLIGHTED RECORDS to determine which records are selected in the subform:
If the subform is set to selection mode "single" then GET HIGHLIGHTED RECORDS is not supported. In this case you can retrieve the current record with the command Selected Record Number:
This Tech Note may be of interest as well: