是不是没有unload完全
你检查一下代码
包括打开数据库后有没有close

解决方案 »

  1.   

    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
      Unload Me
      Set form1 = Nothing
    End Sub
    Private Sub cmd_gyexit_Click()
      Unload Me
      Set form1 = Nothing
    end sub
    这样就能确定窗体不管是用右上角"X"关闭,还是按退出按钮都能正常关闭
      

  2.   

    你还有某些对象在运行。
    如Form ,某些网络或数据库控件/对象等。记得在退出时把它们停止并设为Nothing,当然,最好是不用时就停止和设为Nothing。