José: Como "quitar", lo ignoro, lo que si he hecho en algunas Bases de datos es "Deshabilitarlo"
El código original lo cito, pero lo tengo adaptado a 64 bits.
En un módulo Estándar pones éste Código:
Option Compare Database
Option Explicit
'http://www.fmsinc.com/microsoftaccess/startup/preventclose.asp
'Adaptado a 64 bist por Jacinto Trillo Jareño
#If VBA7 And Win64 Then
Private Declare PtrSafe Function GetSystemMenu Lib "user32" (ByVal hwnd As LongPtr, ByVal bRevert As Long) As LongPtr
Declare PtrSafe Function EnableMenuItem Lib "user32" (ByVal hMenu As LongPtr, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Long
#Else
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal wRevert As Long) As Long
Private Declare Function EnableMenuItem Lib "user32" (ByVal hMenu As Long, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Long
#End If
Public Sub AccessCloseButtonEnabled(pfEnabled As Boolean)
' Comments: Control the Access close button.
' Disabling it forces the user to exit within the application
' Params : pfEnabled TRUE enables the close button, FALSE disabled it
' Owner : Copyright (c) FMS, Inc.
' Source : Total Visual SourceBook
' Usage : Permission granted to subscribers of the FMS Newsletter
On Error Resume Next
Const clngMF_ByCommand As Long = &H0&
Const clngMF_Grayed As Long = &H1&
Const clngSC_Close As Long = &HF060&
#If VBA7 And Win64 Then
Dim lngWindow As Long
Dim lngMenu As LongPtr
Dim lngFlags As Long
#Else
Dim lngWindow As Long
Dim lngMenu As Long
Dim lngFlags As Long
#End If
lngWindow = Application.hWndAccessApp
lngMenu = GetSystemMenu(lngWindow, 0)
If pfEnabled Then
lngFlags = clngMF_ByCommand And Not clngMF_Grayed
Else
lngFlags = clngMF_ByCommand Or clngMF_Grayed
End If
Call EnableMenuItem(lngMenu, clngSC_Close, lngFlags)
End Sub
Para desactivarlo >> Call AccessCloseButtonEnabled(False)
Para volverlo a activar >> Call AccessCloseButtonEnabled(True)
Un saludo >> JTJ