Check of pending records before close the window