Public Function UserMenuControl()
'устанавливает пользовательский профиль меню, если он есть (или его часть)
On Error GoTo Err_UserMenuControl
Dim MySet As Recordset
Set MySet = InfoDB.OpenRecordset("Select UserRight.EmployerID,UserRight.Right,ID1,ID2,ID3 From (UserRight inner Join UserMenuItems on UserRight.IDMenuItem=UserMenuItems.IDMenuItem) Where EmployerID=" & Str$(GlUserID)) 'GlUserID - код пользователя, соответствует EmployerID из таблицы UserRight
If Not MySet.EOF Then
MySet.MoveFirst
While Not MySet.EOF
Call SetMenuUserSecurity(MySet!ID1, MySet!ID2, MySet!ID3, MySet!Right, False)
MySet.MoveNext
Wend
End If
Exit_UserMenuControl:
Exit Function
Err_UserMenuControl:
MsgBox Err.Description
Resume Exit_UserMenuControl
End Function
|