Private Sub Report_Open(Cancel As Integer) Dim xSum, xTyp, xCDokl, xdat2 Dim MyForm As String Dim xRecSrc1 As String, xRecSrc2 As String MyForm = "Zxx_Filter_Mesto" On Error GoTo errdsc DoCmd.RunMacro "Txx_Filter_Mesto.otvor" If ISLOADED(MyForm) Then Me.Filter = filter_text Me.FilterOn = (Len(Me.Filter) > 0) End If errdsc: End Sub
Private Sub Form_Load() If IsInGroup(CurrentUser(), "NaCitanie") = True Then Form.AllowAdditions = False Form.AllowEdits = False Form.AllowDeletions = False End If End Sub
Public Function IsInGroup(UsrName As String, GrpName As String) As Boolean 'Determines whether UsrName is a member of GrpName Dim grp As Group Dim IIG As Boolean Dim usr As User IIG = False For Each usr In DBEngine.Workspaces(0).Users If usr.Name = UsrName Then GoTo FoundUser Next GoTo IIG_Exit FoundUser: For Each grp In usr.Groups If grp.Name = GrpName Then IIG = True Next IIG_Exit: IsInGroup = IIG End Function
Access 2007 tlac z formulara