That won't work.
Why?
Because Access automagically saves the subform record when you move focus from the subform to any control on the main form so by the time your code in the mainform runs, the data from the subform has already been saved.
So, the question becomes what are you trying to do or prevent that you can't just let Access automatically save or don't want to put the save button on the subform?