Selasa, 11 Juli 2017

[MS_AccessPros] About Ribbon in Access 2016

 

So long ago I opened a discussion on the access ribbon, 


I noticed that my access application (access 2007) in Access  2016 

the ribbon did not appear. Then I did a lot of tests and I was able to understand why.


structure:


I have two txt files


RbnProcudure.txt <- Italian menu

RbnProcudure_EN.txt <- english menu



In Access 2007 I have the following procedure that runs in Autoexec:


Public Sub LoadRibbons_Setting ()

    Dim Suf As String

    Dim lngDatei As Long

    Dim strText1 As String

    

    Suf = ""

    

    If TempVars ("Language"). Value = "ENG" Then

        Suf = "_EN"

    End If


    LngDatei = FreeFile

    Open Application.CurrentProject.Path & "\ rbnProcedure" & suf & ".txt" For Input As lngDate

    StrText1 = Input $ (LOF (1), lngDatei)

   

    Close lngDate


    Application.LoadCustomUI "rbnStart", strText1

                                       

End Sub


And in the Option Database -> Current Database I have set the ribbon name with: rbnStat.


And so it works perfectly !!


In Access 2016 does not work .. but if I change


Application.LoadCustomUI "rbnStart", strText1


with


Application.LoadCustomUI "rbnProcedure", strText1 or

Application.LoadCustomUI "rbnProcedure_EN", strText1


And obviously in the Option Database the ribbon name change in rbnProcedure or rbnProcedure_EN the program works well.


Strangely, for me, the name of the .txt file must be the same as the name to be assigned to the ribbon with the application.LoadCustomUI instruction.


I have changed the procedure in:


Public Sub LoadRibbons_Setting ()

    Dim Suf As String

    Dim lngDatei As Long

    Dim strText1 As String

    

    Suf = ""

    

    If TempVars ("Language"). Value = "ENG" Then

        Suf = "_EN"

    End If


    FileCopy Application.CurrentProject.Path & "\ rbnProcedure" & Suf & ".txt", _

             Application.CurrentProject.Path & "\ rbnProcedure.txt"


    LngDatei = FreeFile

    Open Application.CurrentProject.Path & "\ rbnProcedure" & suf & ".txt" For Input As lngDate

    StrText1 = Input $ (LOF (1), lngDatei)

   

    Close lngDate


    Application.LoadCustomUI "rbnProcedure", strText1

                                       

End Sub


And of course in the Option Database set name database ribbon option in: rbnProcedure 

everything and went back to working properly.


I can not understand why?


I apologize if I was not clear


Domenico


__._,_.___

Posted by: domcoz@gmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar