Question Access 2010: How to keep Nav Pane hidden (1 Viewer)

Graysworld

New member
Local time
Today, 10:16
Joined
Jul 21, 2010
Messages
3
Hi people,
Q. In Access 2010, how do you stop a hidden Navigation Pane from being unhidden?

These things I know:
- In MS Access you can hide the Navigation Pane to prevent users from getting to the form objects etc.
- This setting can be bypassed by holding SHIFT while opening the database.
- There is code that can disable the bypass key (the SHIFT key).

In MS Access 2007 this works fine. You can't get to the Options to turn the Nav Pane back on.

But now comes my problem: In Access 2010, the File menu is still visible, which has the 'Privacy Options' available. This lets the user go in and switch the Nav Pane back on again.

How do I stop this in Access 2010? I either need to remove the File menu, or remove the Privacy Options item from it.
 

boblarson

Smeghead
Local time
Yesterday, 17:16
Joined
Jan 12, 2001
Messages
32,059
In both Access 2007 and 2010 you go to Access Options, to CURRENT DATABASE and then uncheck the Allow Default Menus checkbox.
 

Balder

Registered User.
Local time
Today, 02:16
Joined
Jun 21, 2010
Messages
16
Hi

Have been trying to do the same in Access 2010.
But even after unchecking ALLOW FULL MENUS under CURRENT DATABASE, the
user can still click on PRIVACY OPTIONS and change these values back again.

Any way to completely remove this possibility in Access 2010 ?
Have tried to search this forum and Google, but no solution so far.

Perhaps there is some way in VBA ?

Balder
Norway
 

boblarson

Smeghead
Local time
Yesterday, 17:16
Joined
Jan 12, 2001
Messages
32,059
I don't have a copy of 2010 here at work so I'll have to look into it when I get home (unless someone beats me to it, which is fine).
 

ghudson

Registered User.
Local time
Yesterday, 20:16
Joined
Jun 8, 2002
Messages
6,195
Run these two lines when your database first opens...

Code:
        DoCmd.RunCommand acCmdWindowHide
        DoCmd.ShowToolbar "Ribbon", acToolbarNo
 

Balder

Registered User.
Local time
Today, 02:16
Joined
Jun 21, 2010
Messages
16
Hi
Thanks GHUDSON.

Works great.

This will keep some nosy people out of the system......

Balder
Norway
 

Graysworld

New member
Local time
Today, 10:16
Joined
Jul 21, 2010
Messages
3
Run these two lines when your database first opens...

Code:
        DoCmd.RunCommand acCmdWindowHide
        DoCmd.ShowToolbar "Ribbon", acToolbarNo

Rather than hide the whole ribbon, is it possible to hide just the 'File' tab (in Access 2010) or Office button (Access 2007)? Or even better, and more specifically, the 'Privacy Options' item on the File Tab (2010) or 'Access Options' item on the Office button (2007)? Because getting rid of the whole ribbon gets rid of the sorting and record buttons also.
 

vbaInet

AWF VIP
Local time
Today, 01:16
Joined
Jan 22, 2010
Messages
26,374
In Access 2007 you would have to build your own ribbon in XML (if you want to get rib of certain tabs) but I understand in 2010 there's a UI for making this a breeze.
 

Balder

Registered User.
Local time
Today, 02:16
Joined
Jun 21, 2010
Messages
16
I have tried to find out if there is any way to hide the PRIVACY OPTIONS
under FILE TAB in Access 2010.
Tried to look at customized ribbons but found no solution there.

A customized ribbon without the PRIVACY OPTIONS would be perfect for the system i am building now.

If anyone now how to do this in Access 2010 it would be much appreciated.

Balder
Norway
 

Graysworld

New member
Local time
Today, 10:16
Joined
Jul 21, 2010
Messages
3
In Access 2007 you would have to build your own ribbon in XML (if you want to get rib of certain tabs) but I understand in 2010 there's a UI for making this a breeze.

It would be a shame if the Privacy Options couldn't be hidden. I guess it might be a built-in thing, but simply turning off 'full menus' in Options trims down the tabs and tab items, so I would have thought it could be possible to trim just the specific tabs/items that you want using code. I guess not.

In the case that I am forced to make my own ribbon, if I do it in 2010, is it able to be used when running the db on 2007?
 

vbaInet

AWF VIP
Local time
Today, 01:16
Joined
Jan 22, 2010
Messages
26,374
I would imagine ribbons made in 2010 are downward compatible in 2007 since they all use XML.

I haven't used 2010 yet but Bob (aka boblarson) has so he may throw some more light on your Privacy Options problem when he's next on.
 

Balder

Registered User.
Local time
Today, 02:16
Joined
Jun 21, 2010
Messages
16
Hi folks

Finally found the solution to the problem.
You will find all the info you need here : http://www.accessribbon.de/en/index.php?Access_-_Ribbons:Ribbon_XML___Controls

I downloaded the sample databases from here : http://www.accessribbon.de/en/index.php?Downloads

Use these examples to make your own ribbon, easy to disable PRIVACY OPTIONS by doing changes to the XML code in the table.

Then tell ACCESS to load your customized ribbon this way : http://www.accessribbon.de/en/index.php?Downloads:21

Good luck

Balder
Norway
 

drjedi

New member
Local time
Yesterday, 19:16
Joined
Mar 2, 2011
Messages
2
Useful info Balder - thank you; however, it doesn't work for Access Data Projects, that is, in Access projects connected to SQL Server backends, I cannot see the Ribbons via the Access Options --> Current Database --> Ribbon Name route. Using a regular Access database (not data project) I can see the ribbons in the pull-down menu and choose the ribbon I want (MinBackStage works well to minimize Privacy options in File tab).

Does anyone know how to make the Privacy options or File tab disappear in Access data projects?

Thank you.

Jedi
 

ewc

Registered User.
Local time
Yesterday, 17:16
Joined
Oct 18, 2008
Messages
11
This is an undocumented tip I found:
(Add once at start up and add this after every attach / link to external tables)
' hide the navigvation bar
DoCmd.NavigateTo "acNavigationCategoryObjectType"
DoCmd.RunCommand acCmdWindowHide
-------
The above works because it points directly to the navigation pane. Just using docmd.runcommand acwindowhide may be unpredictible because it depends on what had the previous focus:
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo
 
Last edited:

MAHC619

New member
Local time
Today, 04:16
Joined
Jun 19, 2013
Messages
1
Hey guys, m new here and in programming. I have taken help of this site and it has help me a lot.

Comming to the issue:

I have made a database in 2010 and looked almost everything. I even used the below code on the load of a form:
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo

And looked the other details also which dint allow them to see File tab, privacy option, help. So far so good.

But i found out recently that my end user is able to open the database and is also able to see the File tab, privacy option, help. This should not be possible; i dont want it.

Could anyone help me out. I am sorry if am going out of the thread dicussion or something. But guys help me out. Seriously.

Thanks
 

ewc

Registered User.
Local time
Yesterday, 17:16
Joined
Oct 18, 2008
Messages
11
You will need to create a table that is auto-hidden to change the Ribbon. I suggest searching on Gunter Avenius for Access Ribbons.

This is XML code in a table:
Name it: USysRibbons
There are three fields: ID (Long, Autonumber), RibbonName (t, 255) and RibbonXLM (memo)

While this site may discuss the 2007 ribbon in detail, the concepts carry over to 2010/2013. This will replace the normal ribbon, so you need to recreate tools you might need. Note the section on the "backstage" section of this code. The values are all set to false to hide the standard backstage menu items under the file tab. This prevents others from getting to the privacy and Options. The only limitation is it can still be accessed by the cleaver user by bypassing autoexec in your startup routine. Here is a sample:
</ribbon>
<backstage>
<button idMso="FileCloseDatabase" visible="false"/>
<button idMso="SaveObjectAs" visible="false"/>


Once you create the ribbon change, mask the navigation items in Options (uncheck Show System Object and Show Hidden Objects).

That website would also lead you to others who spent a great deal of time developing ribbon menus.
 

ewc

Registered User.
Local time
Yesterday, 17:16
Joined
Oct 18, 2008
Messages
11
billgyrotech:
Once the xml code is in the table, set which section of code to use in the ribbon either in the properties of a form (On Open) or in the Form_Open section in your code. For example, add to Form_Open:
Me.RibbonName = "PrcPreview"
DoCmd.ShowToolbar "Ribbon", acToolbarYes

to display the PrcPreview ribbon section. This code might be quite simple or include 10-20 icons in the ribbon. This sample includes 14 popular print routines (print, export to Excel, PDF, email etc). FYI, I am using Access 2010. If you use an earlier version, set the first line to the right schema year.

I will come back after this post with some code for the ribbon.
Ed
 

ewc

Registered User.
Local time
Yesterday, 17:16
Joined
Oct 18, 2008
Messages
11
Here is the rest of the post:
Once the xml code is in the table, set which section of code to use in the ribbon either in the properties of a form (On Open) or in the Form_Open section in your code. For example, add to Form_Open:
Me.RibbonName = "PrcPreview"
DoCmd.ShowToolbar "Ribbon", acToolbarYes

to display the PrcPreview ribbon section. This code might be quite simple or include 10-20 icons in the ribbon. This sample includes 14 popular print routines (print, export to Excel, PDF, email etc). Here is the entire PrcPreview section in my USysRibbons table. It has other menu items, but this is the first in its entirety. FYI, I am using Access 2010. If you use an earlier version, set the first line to the right schema year:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
<ribbon startFromScratch="true">
<tabs>
<tab id="tabPrintPreview" label="Preview">
<group id="grpPrint" label="Print" visible="true">
<button idMso="PrintDialogAccess" size="large" label="Print" imageMso="PrintDialogAccess"/>
</group>
<group id="grpZoom" label="Zoom" visible="true">
<splitButton idMso="PrintPreviewZoomMenu" size="large"/>
<toggleButton idMso="ZoomFitToWindow" size="large"/>
<toggleButton idMso="ZoomOnePage" size="large"/>
<toggleButton idMso="PrintPreviewZoomTwoPages" size="large"/>
</group>
<group id="grpPageSize" label="Page Size" visible="true">
<gallery idMso="PageMarginsGallery" size="large" />
<gallery idMso="PageSizeGallery" size="large" />
</group>
<group id="grpPageLayout" label="Page Layout" visible="true">
<toggleButton idMso="PageOrientationPortrait" size="large"/>
<toggleButton idMso="PageOrientationLandscape" size="large"/>
</group>
<group id="grpData" label="Data" visible="true">
<control idMso="PublishToPdfOrEdoc" size="large" label="Export to PDF" enabled="true"/>
<button id="btnexporttoexcel" label="Excel" size="large" imageMso="ExcelSpreadsheetInsert" onAction="ExporttoExcel"/>
<button id="btnexporttohtml" label="HTML" size="large" imageMso="ExportHtmlDocument" onAction="ExporttoHTML"/>
<button id="SendviaEmail" label="Email" size="large" imageMso="EnvelopesAndLabelsDialog" onAction="SendViaEmail"/>
</group>
<group id="grpClosePreview" label="Close Preview" visible="true">
<button idMso="PrintPreviewClose" size="large" label="Close Preview" visible="true" imageMso="PrintPreviewClose"/>
</group>
</tab>
</tabs>
</ribbon>
<backstage>
<button idMso="FileCloseDatabase" visible="false"/>
<button idMso="SaveObjectAs" visible="false"/>
<button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
<button idMso="FileOpen" visible="false"/>
<button idMso="FileSave" visible="false"/>
<tab idMso="TabInfo" visible="false"/>
<tab idMso="TabRecent" visible="false"/>
<tab idMso="TabNew" visible="false"/>
<tab idMso="TabPrint" visible="false"/>
<tab idMso="TabShare" visible="false"/>
<tab idMso="TabHelp" visible="false"/>
<button idMso="ApplicationOptionsDialog" visible="false"/>
<button idMso="FileExit" visible="true" label="Exit Database"/>
</backstage>
</customUI>

---Each of my reports uses this ribbon, so I add to each one:
Me.RibbonName = "PrcPreview"
DoCmd.ShowToolbar "Ribbon", acToolbarYes

To stop displaying that ribbon, replace it with another or just use in the On Close section:
DoCmd.ShowToolbar "Ribbon", acToolbarNo

You will also note the the lower section titled "backstage" sets the visible "File" section so all you can do is close the database (FileExit).
 

Users who are viewing this thread

Top Bottom