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) |
Tidak ada komentar:
Posting Komentar