Hi guys,
I have a multi-user database. I would like based on the logged-in user, some buttons and controls in different forms be disabled and the others be enabled.
There is a login form that gets the username; I made also a function to define authorities for users in it.
My plan is that when user enters to the database, on load of the main menu the function calls and disables the defined controls in different forms.
I tried to use this kind of codes:
Function User_1()
[Forms]![frmMainMenu].[cmdUpdateDatabase].Enabled = False
[Forms]![frmChooseReports]![cmdOrdersFollowUpReports].Enabled = False
End Function
Function User_2()
[Forms]![frmMainMenu].[cmdChooseCharts].Enabled = False
End Function
But this code only works for the forms that are opened at the moment and if one of them is closed the system gives Error.
Could anyone help me on solving this matter?
I have a multi-user database. I would like based on the logged-in user, some buttons and controls in different forms be disabled and the others be enabled.
There is a login form that gets the username; I made also a function to define authorities for users in it.
My plan is that when user enters to the database, on load of the main menu the function calls and disables the defined controls in different forms.
I tried to use this kind of codes:
Function User_1()
[Forms]![frmMainMenu].[cmdUpdateDatabase].Enabled = False
[Forms]![frmChooseReports]![cmdOrdersFollowUpReports].Enabled = False
End Function
Function User_2()
[Forms]![frmMainMenu].[cmdChooseCharts].Enabled = False
End Function
But this code only works for the forms that are opened at the moment and if one of them is closed the system gives Error.
Could anyone help me on solving this matter?