Te gebruiken lint afhankelijk van gebruikersgroep Access 2007

Status
Niet open voor verdere reacties.

hansvds

Nieuwe gebruiker
Lid geworden
31 okt 2007
Berichten
3
Ik ben op zoek naar de VB code die afhankelijk van de groep waartoe de ingelogde gebruiker behoort een bepaald in de Usysribbons tabel aanwezig lint activeert.
Ik gebruik onderstaande code. Die selecteert wel het juiste lint maar de activering/display ervan gebeurt niet. Wat doe ik fout of heb ik over het hoofd gezien?
:(

'This form starts the application
Option Compare Database 'Use database order for string comparisons
Option Explicit

'------------------------------------------------------------
' Selekteer en display het betreffende lint op basis van de gebruikersgroep
'
'------------------------------------------------------------
Private Sub Form_Activate()
On Error GoTo Form_Activate_Err

Dim strXML As String
Dim strName As String
Const Home As String = "Home"
Const Develop As String = "Develop"
Dim Boodschap As String

If Forms!Opening![Gebruikersgroep] = "Klant" Then
strName = Home
ElseIf Forms!Opening![Gebruikersgroep] = "Admins" Then
strName = Develop
End If

Boodschap = " 1"
strXML = DLookup("RibbonXML", "USysRibbons", "RibbonName = '" & strName & "'")
Boodschap = " 2"
Call Access.Application.LoadCustomUI(strName, strXML)

Form_Activate_Exit:
Exit Sub

Form_Activate_Err:
MsgBox "Er is een fout opgetreden." & (Chr(13) & Chr(10)) & Boodschap, vbExclamation, "Logische fout!"
Resume Form_Activate_Exit

End Sub

'------------------------------------------------------------
' Hou het openings formulier 5 seconde open en ga dan naar het Hoofdmenu
'
'------------------------------------------------------------
Private Sub Form_Timer()
On Error GoTo Form_Timer_Err

Form_Timer_Exit:
' Form stays open for 5 seconds, then closes...
DoCmd.Close acForm, Me.Name

'open het hoofdmenu
' DoCmd.OpenForm "Hoofdmenu", acNormal, , , acFormReadOnly, acWindowNormal
Exit Sub

Form_Timer_Err:
Resume Form_Timer_Exit

End Sub
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan