Do you mean DISPLAY or HIDE a subform in a form using a command button? If so, then the answer is yes. There are many ways to do it.
1. You can leave it there and just set the subform control's visible property to be NO at first and then just have the click event of the button set it visible or not:
Me.YourSubformControlName.Visible = Not Me.YourSubformControlName.Visible
2. Or if you don't want the records loaded first, you can remove the source object of the subform control before saving the form and then assign it at the click of the button:
Me.YourSubformControlName.SourceObject = "YourSubformNameHere"