none
How to disable contextualTabs in Access 2010

    Question

  • Using Access 2010. I am using a custom ribbon with startfromscratch=true. My custom tabs/buttons appear and work. However when a form is open in datasheet view, the contextual datasheet tab suddenly appears. This tab contains the button to switch to design view - something users should not have access to. I have found info on creating one's own contextual tab, but nothing on disabling the built-in one. How can this be disabled?
    lundi 13 juin 2011 00:32

Réponses

  • Tada-da!

     

    <contextualTabs>
      <tabSet idMso="TabSetFormDatasheet" visible="false" />
    </contextualTabs>
    
    

     


    This hides DataSheet contextual tab in Form Tools Ribbon section, I've just tested it with Northwind sample. There is a StartUp form with a datasheet subform which shows us Form Tools -> Datasheet contextual tab immediately after opening. After applying this piece of xml this contextual tab disappears.

    There idMso for all existing tabSets:

         Control Name:       TabSetFormToolsLayout TabSetFormTools TabSetReportToolsLayout TabSetReportTools TabSetRelationshipTools TabSetQueryTools TabSetMacroTools TabSetPivotTableAccess TabSetPivotChartAccess TabSetTableToolsDatasheet TabSetTableToolsDesign TabSetFormDatasheet TabSetAdpFunctionAndViewTools TabSetAdpStoredProcedure TabSetAdpSqlStatement TabSetAdpDiagram TabSetFormReportExtensibility  

    You can find them in this download: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=3F2FE784-610E-4BF1-8143-41E481993AC6


    Andrey V Artemyev | Saint-Petersburg, Russia
    • Marqué comme réponse Alphonse G lundi 20 juin 2011 18:26
    lundi 20 juin 2011 16:58

Toutes les réponses

  • Hi Alphonse G,

    It will be appreciate if you can upload your demo Access file to the skydrive: http://www.skydrive.com ? Because it is hard for me to reproduce your scenario on my side. I will do further research about your problem and try to give you the workaround.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    mardi 14 juin 2011 04:14
  • Bruce,

    I don't have a demo. Don't know when I would get time to build one.

    Isn't there any info available on controlling contextual tabs?

    mercredi 15 juin 2011 01:17
  • Hi Alphonse G,

    Please take a look at these two articles can help you:

    http://www.accessribbon.de/en/?Access_-_Ribbons:Ribbon_XML___Controls:ContextualTabs

    http://msdn.microsoft.com/en-us/library/ee264329(VS.85).aspx

    Besed on my experience, we can't disable the built-in contextual tabs, please refer to this thread:http://social.msdn.microsoft.com/Forums/en-SG/vsto/thread/4ad57892-e1d1-40bb-825f-cf8032607581 which states that we can't disable built-in ones.

    Hope you can figure it out.

    Best Regards,

     

     

     


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    mercredi 15 juin 2011 12:03
  • Hi Alphonse G,

    What is the status of the problem on your side? Did you still have the problem about contextualTabs? Just feel free to let us know, we will try our best to help with you.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    lundi 20 juin 2011 11:18
  • Bruce, Yes, I still have the problem. The links were of no help, as I need to disable, not create, the contextual tab. Access 2007 has contextual tabs and there is no problem. I even tried creating my on contextual tab, hoping that it might override the built-in one, but it just becomes an addition. I specify the ribbon to 'startfromscratch'. Access including a built-in contextual tab is NOT starting from scratch. How is it that MS would put in that 'feature' and not have a method to disable it. Especially, the design view button. That is just outright ridiculous. We developers design systems for users who sometimes barely know how to use a mouse - and Microsoft decides that they should have access to design of a system? While not hopeful, I am now waiting for Office 2010 SP1 to come out, to see it has been fixed.
    lundi 20 juin 2011 12:42
  • Especially, the design view button.

    Do you mean a button on the Home tab? If you do, it can be hidden with:

    <tab idMso="TabHomeAccess" visible="true">
     <group idMso="GroupViews" visible="false" />
    </tab>
    
    
    

    If you mean Design contextual tab like this one for PivotChart Tools

    Design

    then I can't help you yet.


    Andrey V Artemyev | Saint-Petersburg, Russia
    lundi 20 juin 2011 12:58
  • Thanks for the reply Andrey, No, not the button on the home tab. I am using startfromscratch=true, so there is no home tab, just my own custom tabs (plus the contextual tab that I don't want). This is a contextual tab that appears when a form is open. It does look similar to the pivotcharttools tab that you mention, but this appears with forms.
    lundi 20 juin 2011 13:04
  • Alphonse, understood. I'll take a look at home, has no A2010 right now.

    P.S. I know one person who should know the answer. Gunter, where are you? :)


    Andrey V Artemyev | Saint-Petersburg, Russia
    lundi 20 juin 2011 13:10
  • Thanks Andrey, You are probably right. If anyone knows the answer it would be Gunter, but I've searched his website and can't find anything.
    lundi 20 juin 2011 13:22
  • Tada-da!

     

    <contextualTabs>
      <tabSet idMso="TabSetFormDatasheet" visible="false" />
    </contextualTabs>
    
    

     


    This hides DataSheet contextual tab in Form Tools Ribbon section, I've just tested it with Northwind sample. There is a StartUp form with a datasheet subform which shows us Form Tools -> Datasheet contextual tab immediately after opening. After applying this piece of xml this contextual tab disappears.

    There idMso for all existing tabSets:

         Control Name:       TabSetFormToolsLayout TabSetFormTools TabSetReportToolsLayout TabSetReportTools TabSetRelationshipTools TabSetQueryTools TabSetMacroTools TabSetPivotTableAccess TabSetPivotChartAccess TabSetTableToolsDatasheet TabSetTableToolsDesign TabSetFormDatasheet TabSetAdpFunctionAndViewTools TabSetAdpStoredProcedure TabSetAdpSqlStatement TabSetAdpDiagram TabSetFormReportExtensibility  

    You can find them in this download: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=3F2FE784-610E-4BF1-8143-41E481993AC6


    Andrey V Artemyev | Saint-Petersburg, Russia
    • Marqué comme réponse Alphonse G lundi 20 juin 2011 18:26
    lundi 20 juin 2011 16:58
  • Fantastic! Works great!

    Thank you!

    Great find!

    lundi 20 juin 2011 18:27