Not allow a value change in a combo box if you are not authorized.
Posted on 2007-08-08
I have a combo filed in Access Project (backend Sql Server) that only specific set of users are allowed to change the value. This code works somewhat in that it will give you an error but will still allow the value to change and the undo command does not work to undo the value and gives an error and the "not authorized person" is able to change the value. I have tried to use Beforeupdate, afterupdate and even mouse down. Any help .....please.
Dim pername As String
Dim adminname As String
Dim executive As String
pername = "TerryS"
adminname = "PeggyW"
executive = "GeorgeL"
If pername = fOSUserName() Then
If adminname = fOSUserName() Then
If executive = fOSUserName() Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
MsgBox fOSUserName() & ", You are not permitted to change the Rating."