Are you using macros or code, and where did you place the button? AFAIK, a macro is invoked against, or the actions can only apply to, the object that has the focus. So I believe putting your button on the main form won't work with a macro action meant to work on a sub form. Assuming this is a macro, you might succeed if you set the focus to the sub form first. The reason I don't sound too sure is that I almost never use macros. In case you want to try this, there is a proper syntax for referring to the hierarchy of a form/sub form relationship. To drill down to a subform control, it's
[Forms]![Main form name]![subform control name].[Form]![control name on subform]
where [subform control name] is the name of the control that contains the subform, not the subform itself. If you're only trying to refer to the subform, I believe it would be
[Forms]![Main form name]![subform control name].[Form].SetFocus
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.