Results 1 to 6 of 6
  1. #1
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107

    report close


    I have a report that should close only on a button click, I want to prevent users from manually closing this report using the x button.
    I changed the "close button" option in the report properties to No, but the user is still able to right click on the report and close it.
    Any help?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,515
    Thats what the X button is for....to close the report.
    Why re-invent the wheel that is already there?

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    Report in PrintPreview is not interactive. Custom command buttons will not work.

    ShortcutMenu can be individually disabled on forms but not reports. Can programmatically create an alternate shortcut menu and force report to use that with ShortcutMenuBar property. I have never done this. I globally disable shortcut menu in db Options settings.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    ijaz8883 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    103
    Quote Originally Posted by bilalo View Post
    I have a report that should close only on a button click, I want to prevent users from manually closing this report using the x button.
    I changed the "close button" option in the report properties to No, but the user is still able to right click on the report and close it.
    Any help?
    You may do this. See this thread and download the sample file and check the report. Its have already x button hidden mode.
    https://www.accessforums.net/showthread.php?t=76008

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,946
    The only reason I can see for doing this is to have code run from your custom close button.
    If so, I would just put the code in the Report_Close event & scrap the button

    However if you really want to do this for some reason, set the report properties as shown:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	15 
Size:	17.2 KB 
ID:	37828

    Make sure you open the report in Report view so that your Close button is visible
    If you use print preview, the button will not display and users will be able to close the report from the Print Preview ribbon
    Last edited by isladogs; 03-14-2019 at 02:02 PM. Reason: Typo
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,702
    Setting those properties won't prevent right click & Close. No one has asked why the OP wants to remove all possibilities for eliminating the built in close methods??
    I agree - move any code to the report unload or close event.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Bypassing the On Close Event in a Report
    By Oxygen Potassium in forum Access
    Replies: 5
    Last Post: 06-06-2017, 11:52 AM
  2. Replies: 4
    Last Post: 01-31-2014, 11:47 AM
  3. Replies: 1
    Last Post: 01-28-2013, 03:46 PM
  4. Replies: 2
    Last Post: 06-20-2011, 03:10 PM
  5. Report close problem after maximized
    By blueraincoat in forum Reports
    Replies: 5
    Last Post: 05-15-2011, 12:23 AM

Tags for this Thread

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