vb6, DAO在編輯模式或新增模式 , 關掉程式, 如何避免新增一筆空(編號:1099)

'我的程式碼 :
'datLM 為 DAO
'結果若在編輯模式或新增模式 , 關掉程式, 照樣關掉, 且不出現 'MsgBox , 並新增一筆空白資料.
'請釋疑 !!

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If datLM.Recordset.EditMode <> dbEditNone Then
   MsgBox "Please Save or Cancel ! Then you can Exit. ", vbExclamation, "LandMark"
   Cancel = True
   Exit Sub
  End If
End Sub
把"Exit Sub"刪去 , 還是有問題 ! 情形還是一樣 !!

是不是vb6對DAO無法做此項檢驗 ?????