Hide/Unhide Close Form Button (NOT the Close MS Access Button)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chip0105
    New Member
    • Nov 2013
    • 9

    Hide/Unhide Close Form Button (NOT the Close MS Access Button)

    I have specific forms that I need to hide or disable the FORM close button for certain individuals and have it available for others.

    I researched this for the past three (3) days and all I could find were posts on how to disable the red MS Access close button on the top right of the screen. This is NOT what I am looking for.

    I thought this would be fairly simple to find but has proven to be VERY difficult to say the least.

    Any assistance would be greatly appreciated.


    [imgnothumb]http://bytes.com/attachments/attachment/7304d1384281910/form-close-button.jpg[/imgnothumb]
    Attached Files
    Last edited by zmbd; Nov 18 '13, 09:41 PM. Reason: [z{placed image inline}]
  • CJ_London
    New Member
    • Nov 2013
    • 28

    #2
    I don't think this can be done in tabbed document style - you would need to change your forms to overlapping.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      To disable/remove it goes against what is considered to be the standard for window/form design.

      I can understand the reason/desire to disable this button as clicking it at the wrong time can cause multiple headaches.

      In anycase, I trap in the form unload event.
      Several methods...
      Say I have a transaction open, I set a flag at the form level that there is a transaction open. In the form unload event I check for that flag (or count as you can have multiple tranactions open). If the flag/count isn't clear then I cancel the event and tell the user to be patient and finish or use the correct button to cancel the transaction.
      You can also check if the form is dirty and proceede from there - see the order of events here: Order of events for database objects (v2010)


      In anycase to answer your question:
      This will not hide the close button; however, it will disable it for that form.
      Open form in design view
      Click on any control and show the properties pane
      In the dropdown list at the top of the pane select "Form"
      Click on the format tab
      Look about mid way down the list for "Close Button" property
      Set to "No"

      I highly advise against this as all your users will then do is close the application itself and start from scratch. Even with the traps, they might just close the app from the OS and there's not much one can do about that!

      End users can be too smart for their own good sometimes! };-)
      -z
      Last edited by zmbd; Nov 18 '13, 10:08 PM.

      Comment

      Working...