Public Function Macro_Barre_de_Menu(MN As String)
Dim J As Integer
Dim NOMRUBAN
Dim Ok As Boolean
NOMRUBAN = ""
Ok = False
For J = 0 To Forms.count - 1
If Forms(J).FormName <> "Menu Démarrage" And Forms(J).FormName <> "Palette (H)" And Forms(J).FormName <> "Palette (V)" Then
Beep
TXTMSG = Message(999)
MsgBox TXTMSG, 16, "PROGECOM12"
DoCmd.CancelEvent
GoTo ANULBARRE
End If
Next J
J = 0
For J = LBound(P_SOUSRIBBONS) To UBound(P_SOUSRIBBONS)
If MN = P_SOUSRIBBONS(J)(0) Then
NOMRUBAN = P_SOUSRIBBONS(J)(0) & IIf(IsNull(USERLG), "_1", "_" & USERLG)
Ok = True
Exit For
End If
Next
If Not Ok Then GoTo ANULBARRE
Ribbon_Name = NOMRUBAN
For J = 0 To Forms.count - 1
Forms(J).RibbonName = Ribbon_Name
Next
Forms![Menu Démarrage].SetFocus
ANULBARRE:
End Function
Dim J As Integer
Dim NOMRUBAN
Dim Ok As Boolean
NOMRUBAN = ""
Ok = False
For J = 0 To Forms.count - 1
If Forms(J).FormName <> "Menu Démarrage" And Forms(J).FormName <> "Palette (H)" And Forms(J).FormName <> "Palette (V)" Then
Beep
TXTMSG = Message(999)
MsgBox TXTMSG, 16, "PROGECOM12"
DoCmd.CancelEvent
GoTo ANULBARRE
End If
Next J
J = 0
For J = LBound(P_SOUSRIBBONS) To UBound(P_SOUSRIBBONS)
If MN = P_SOUSRIBBONS(J)(0) Then
NOMRUBAN = P_SOUSRIBBONS(J)(0) & IIf(IsNull(USERLG), "_1", "_" & USERLG)
Ok = True
Exit For
End If
Next
If Not Ok Then GoTo ANULBARRE
Ribbon_Name = NOMRUBAN
For J = 0 To Forms.count - 1
Forms(J).RibbonName = Ribbon_Name
Next
Forms![Menu Démarrage].SetFocus
ANULBARRE:
End Function