I took too long to edit, so here's a repost
There's a good chance that when user clicks the button, the record is saved. This is the usual behaviour of subforms when they're bound. You didn't say if either form was bound or not. If not, you cannot check the dirty property of an unbound form. If you see the edit icon (pencil) on the subform and it disappears when you click off of the form, then the record should be saved already, thus you can't undo it.
Since the button is not on the subform, you'll need the syntax for referring to a subform from the parent form:
Forms!frmName.SubformControlName.Form.Dirty
SubformControlName is the name of the control containing the subform - not the subform name. They shouldn't be the same IMHO.
The only way you can detect if a form was changed when Access is updating the record due to lost focus or similar action, is to have a module or procedure level variable that gets set to True as soon as the user changes data in a record.
The only way I know of is to provide this functionality is to copy a record to a temp table and use the variable in code as described. If the user is prompted and elects to save, you copy the record back and delete the temp. If they cancel, you simply delete the temp record. You have to design so that one user is not deleting records of another when doing this.