Full Version: How to prevent certain value from being updated in a field
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
azzaro69
Dependent on the user name I want to restrict certain user from updating a certain value in a field i.e.if username A entered a value say "CAT" an error msg will pop-up however for username B if he entered "CAT" it is OK.

TQ in advance.
dannyseager
In the before update event of the control add in

If Username<>"UsernameA" then
Msgbox "Only Username A can edit this
cancel=true
else
end if

This code will not work but it gives you an idea... The code needs modifying depending on how you determine who the current user is.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.