Results 1 to 5 of 5
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    Disable close button in appliction window

    Hi



    it seems from my research there is no easy way to hide the close button in the application window.

    Various sites offer code modules but is there a better way?

    thanks

    Ian

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    it wouldnt matter anyway, theres lots of ways to close a screen.
    close button
    The corner X button
    Alt-F4

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Opening a form as Modal will disable the application close button. The downside of opening a form as modal is that eveything outside the form is disabled, including the ribbon and navigation pane.

  4. #4
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453
    Hi
    Thanks I'l just lea it
    cheers

    an

  5. #5
    Join Date
    Aug 2016
    Posts
    1
    Option Compare Database
    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



    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

    On Error Resume Next

    Const clngMF_ByCommand As Long = &H0&
    Const clngMF_Grayed As Long = &H1&
    Const clngSC_Close As Long = &HF060&

    Dim lngWindow As Long
    Dim lngMenu As Long
    Dim lngFlags As Long

    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


    Verstuurd vanaf mijn P9000 met Tapatalk

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to disable just close button but keep min/max?
    By mjhd786 in forum Programming
    Replies: 2
    Last Post: 02-19-2015, 02:37 PM
  2. How to disable the "close" button in Access
    By Demerit in forum Access
    Replies: 7
    Last Post: 12-08-2013, 07:08 PM
  3. How to disable save/close window in form
    By Kivan in forum Access
    Replies: 2
    Last Post: 08-16-2012, 02:52 AM
  4. Disable master form close button
    By Carpy01 in forum Forms
    Replies: 3
    Last Post: 12-31-2010, 05:41 PM
  5. Disable App Close button in 2007
    By ajetrumpet in forum Programming
    Replies: 3
    Last Post: 09-05-2010, 11:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums