I tried this one.
But its throwing an error on the
Code:
btnOpenProj.enabled = bIsAllowed

Originally Posted by
ranman256
your
EmpToProj_tbl would have those people assigned to the project,
when a user want to open the project, check the list to see if they are allowed (in form)
get their userID at form open,
Code:
sub Form_Load()
dim vUserID
dim bIsAllowed as boolean
'get user id
vUserID = Environ("Username")
'see if user can open this project
bIsAllowed =Not IsNull( Dlookup("[userID]" , "EmpToProj_tbl","[UserID]='" & vUserID & "' and [ProjID]=" & cboProj) )
btnOpenProj.enabled = bIsAllowed
end sub