PMJIH
For one thing, I recommend
If (IsNull(Me.Creator)) Or (CurrentUser() = "Admin1") Or (CurrentUser() = "Admin2") Then
Add the parens around the CurrentUser tests. Your syntax is correct. But I find that functions (such as IsNull or CurrentUser) can result in odd interpretations.
Troubleshooting tip:
Try breaking this into three different if statements using ElseIf.
If Isnull(me.Creator) then
{ unlock code }
elseif CurrentUser = "Admin1" then
{ unlock code }
elseif CurrentUser = "Admin2" then
{ unlock code }
else
{ lock code }
end if
I wouldn't leave it that way. But the idea is to be sure the rest of the code is working right. Or for that matter, just try one value at a time.
Another idea for your if... If all Admin users start with Admin you could try:
If (IsNull(Me.Creator)) Or (left(CurrentUser() & " ",5) = "Admin") Then
The '& " "' is to make sure CurrentUser has at least five characters. This check means you won't have to change your code if you add Amdin3.
One last tip...
Just in case Me.Creater is "" (an empty string) instead of null, try:
If (nz(Me.Creator,"") = "") Or (left(CurrentUser(),5) = "Admin") Then
The nz will convert null to an empty string. Then regardless whether your data is an empty string or null you'll pass that part of the test.
Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group
http://www.pnwadg.org