I figured it out! Just incase a new user is looking for just this. Here is the code:
On Error GoTo Solution_Click_Err
If (Form.Dirty) Then
DoCmd.RunCommand acCmdSaveRecord
End If
If (IsNull(ID)) Then
On Error GoTo 0
DoCmd.OpenForm "Main", acNormal, "", ""...