Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389

    How to lock all controls in print preview


    I have prepared a print report. When its print preview is opened, the print settings ribbon and navigation pane is also shown as shown in the attached pic. I want only the page shown in the circle to be shown in the print preview window. I tried a lot for this and also searched on Google but till now I am not getting success, please guide me properly.
    Thank you.
    Attached Thumbnails Attached Thumbnails printUntitled.png  

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,354

  3. #3
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by CJ_London View Post
    Thanks, this is the same as removing the ribbon from the form. Is there a way to remove the ribbon in print preview but keep the print button bar visible? like attached picture
    Attached Thumbnails Attached Thumbnails 20prUntitled.png  

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,354
    I don't see the print button bar in your original screenshot and not sure what it is.

    perhaps this link will help
    https://bytes.com/topic/access/answe...-print-preview

  5. #5
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by CJ_London View Post
    I don't see the print button bar in your original screenshot and not sure what it is.

    perhaps this link will help
    https://bytes.com/topic/access/answe...-print-preview
    This print bar is shown in any other sql based software. I posted this as an example. This print bar shows that all settings related to the print preview are locked. The user cannot make any changes to the page settings except giving print commands in the print preview.
    Is it possible to make such a print bar or get it shown?
    Thank you.

  6. #6
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    I check your suggest link.
    Thank you

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,752
    For custom ribbons, explore this site https://www.avenius.de/en/

    Can use File > Options to hide navigation pane.

    Be aware that shift key bypass will cause db to open ignoring Option 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.

  8. #8
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by CJ_London View Post
    I don't see the print button bar in your original screenshot and not sure what it is.

    perhaps this link will help
    https://bytes.com/topic/access/answe...-print-preview
    Thanks CJ London
    On the link you suggested I found the statement that hides the navigation pane and ribbon by entering the onload event of the dashboard or login form followed by the coding described to show the custom tab created in riboon It is not working and the comment on this link is also incomplete.

    Private Sub Form_Load()
    'Hide the menus and Objects

    Dim i As Integer
    For i = 1 To CommandBars.Count
    CommandBars(i).Enabled = False
    Next i

    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.ShowToolbar "Menu Bar", acToolbarNo
    DoCmd.SelectObject acTable, , True
    DoCmd.RunCommand acCmdWindowHide

    End Sub

  9. #9
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by June7 View Post
    For custom ribbons, explore this site https://www.avenius.de/en/

    Can use File > Options to hide navigation pane.

    Be aware that shift key bypass will cause db to open ignoring Option settings.
    Thanks june
    1. From the link suggested by you, I have got such an app which creates a custom tab on the ribbon, after this the same tab shows in the ribbon which has been created, and all the other tabs get auto hide. I would like to know what is the difference between creating a custom tab from the customized ribbon in Access and creating a tab from this app. Is the main difference is that it will show custom tabs but will automatically hide all other tabs?

    2. Custom tab is showing in all the forms but I want it to show in my print report only. Please tell what I have to do for this. I studied a lot on this link but I could not find the table "USysRibbons" mentioned on this link anywhere and even if I find this table, what should I do in it, please give your valuable suggestions.

    https://bytes.com/topic/access/answe...-report-opened

    3. I find the onload event code suggested by CJ London better for hiding the navigation pane. Please tell me what is the difference between hiding the navigation pane by option and hiding it by code and which method will be better.

    Private Sub Form_Load()
    'Hide the menus and Objects

    Dim i As Integer
    For i = 1 To CommandBars.Count
    CommandBars(i).Enabled = False
    Next i

    DoCmd.ShowToolbar "Ribbon", acToolbarNo
    DoCmd.ShowToolbar "Menu Bar", acToolbarNo
    DoCmd.SelectObject acTable, , True
    DoCmd.RunCommand acCmdWindowHide

    End Sub


    4. I tried pressing shift key several times but it did not do anything. Please tell me where am I going wrong in understanding your last point.
    thank you very much again.

  10. #10
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,354
    I'm now totally confused. OP said this was for a report print preview yet the code is in a form open event.

    and comments such as ' It is not working ' do not help with finding a solution - what does ' It is not working ' mean? you get an error, nothing happens? something else?

    Have you stepped through the code to see what happens at each line?

    Best guess is the code is not running since there are no form events in a report

  11. #11
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,752
    The intrinsic "Customize Ribbon" allows adding or removing commands from the ribbon. Can also do some organizing with new tabs and groups. Does not allow to remove standard tabs and groups. Does not allow presentation of different ribbons for different circumstances. Between ribbon customization and File > Options settings and VBA, standard ribbon, navigation pane, X close, right click shortcut menu, function keys are all disabled. Designed a custom ribbon for display when report is in PrintPreview. Report Ribbon property calls custom ribbon to provide users a Print button. I don't disable shift key bypass because my users don't know it and I open development master of database with it when I want to modify (hold shift key down while opening db). It's a small office and less than a dozen users. Never bothered with deploying executable version.
    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.

  12. #12
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by CJ_London View Post
    I'm now totally confused. OP said this was for a report print preview yet the code is in a form open event.
    You are right, in the link suggested by you at point four, the code to hide the ribbon and navigation is working properly but the code to call the custom ribbon in the print preview is not working properly and in the property of the report other Custom ribbon is not showing even in the drop down named ribbon in tab and there is no further discussion on the given link to resolve this error.

  13. #13
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by June7 View Post
    The intrinsic "Customize Ribbon" allows adding or removing commands from the ribbon. Can also do some organizing with new tabs and groups. Does not allow to remove standard tabs and groups.
    I understood what you said.

    Quote Originally Posted by June7 View Post
    Does not allow presentation of different ribbons for different circumstances.
    I created a custom ribbon with Ribbon Creator software and added print, print close, zoom buttons to it. Now the problem is that the print button is getting enabled in all forms with print preview whereas this button or this custom ribbon should be enabled only at the time of print preview. I could not find this type of setting neither in the Ribbon Creator software nor in the Access file. Please suggest any solution to resolve this problem.

    Quote Originally Posted by June7 View Post
    Between ribbon customization and File > Options settings and VBA, standard ribbon, navigation pane, X close, right click shortcut menu, function keys are all disabled.
    Are you trying to explain the code suggested by cj london to hide the navigation pane and ribbon?

    Quote Originally Posted by June7 View Post
    when report is in PrintPreview. Report Ribbon property calls custom ribbon to provide users a Print button.
    Custom ribbon is getting called in every forms with print preview

    Quote Originally Posted by June7 View Post
    I don't disable shift key bypass.
    Oh thank you, now I understand your point but if you ever want to enable shift key bypass, then please tell me from where it is done.

    Quote Originally Posted by June7 View Post
    Never bothered with deploying executable version.
    I am not able to understand this point, please explain this point a little.

    thank you very much.

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,752
    In my arrangement I created two ribbons. One without Print functionality is default (everything is deactivated, basically a blank ribbon and reduced Quick Access Toolbar). The other is only active for report and offers Print button. This secondary ribbon is activated by report RibbonName property.

    I was not trying to explain C.J.'s code - just indicating what can be accomplished with available methods.

    Shift key bypass is always available by default. If you don't want it used, you have to take action to prevent.

    You should do research on deploying executable Access database. This is a compiled version that users cannot modify and cannot view VBA - usually an accde.
    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.

  15. #15
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by June7 View Post
    The other is only active for report
    I just can't figure out how to make this kind of ribbon. I. Whatever ribbon I make is shown everywhere, I cannot find a way to stop it.

    Quote Originally Posted by June7 View Post
    I was not trying to explain C.J.'s code - just indicating what can be accomplished with available methods.
    So far, I have liked the code suggested by CG London for this and the second method change the file extension accdb to accdr and the third method you have suggested accde extension on which I will Google. According to you, which of these three method does better.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-21-2022, 02:39 AM
  2. Replies: 5
    Last Post: 09-16-2019, 01:12 AM
  3. Replies: 1
    Last Post: 12-13-2018, 01:06 PM
  4. Replies: 5
    Last Post: 07-29-2014, 01:05 PM
  5. Replies: 6
    Last Post: 03-01-2014, 07:07 AM

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