View Single Post
Old 09-14-2019, 07:36 AM   #21
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,342
Thanks: 67
Thanked 2,678 Times in 2,564 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Run code before close report

you put it here:
Code:
Select Case [Forms]![FormLogin].[txtDienstID]
       Case 1, 2, 5, 8
            CurrentDb.Properties("AllowShortcutMenus") = True
       Case Else
            CurrentDb.Properties("AllowShortcutMenus") = False
       End Select

Tempvars.Add "allow_shortcut", (Instr(1, ",1,2,5,8", "," & [Forms]![FomLogin]![txtDienstID] & ",") > 0)
now on open event of all Reports:
Code:
Private Sub Report_Open(Cancel As Integer)
If [Tempvars]![allow_shortcut] = False Then
   'not admins
    Me.ShortcutMenuBar = "menu_print2"
Else
    Me.ShortcutMenuBar = "menu_print"
End If
End Sub
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote