I can see how that would work for you. But, personally, I find such
approaches messy. I think a much cleaner and sounder approach would be to
set up a simple table with four fields: CtrlName, User1, User2, User3.
CtrlName is text, and User1-3 are boolean(yes/no). You would enter the
controls you want to lock for one more users in the table, and check the box
for the users for which is should be locked. Then, when looping through the
controls: 1) if the control is not listed in the table, do nothing; 2) if
the control is listed in the table, look up the value in the field that
corresponds to the current user, and, if True, then lock the field;
otherwise, unlock the field.
This approach, obviously, has its limitations, since, if you add users,
you'd have to add fields to the table. But, from what it sounds like, that
sounds like it would be infrequent, if at all.
A better approach still would be to use an array based on a user-defined
type, using the same structure as noted above for the table. That would be
very easy to modify and wouldn't have the overhead of the table.
Anyway, that's how I would do it. But if what you've done works for you,
then great. Glad you got it working!
Neil
"Keith Wilby" <he**@there.comwrote in message
news:47**********@glkas0286.greenlnk.net...
"Keith Wilby" <he**@there.comwrote in message
news:47**********@glkas0286.greenlnk.net...
In case anyone's interested, I assigned the usernames to the tag property
User1User2User3
and then used the left, mid and right functions to compare the tag
properties to CurrentUser
If Left(Me.ActiveControl.Tag,5) = CurrentUser Or .... etc
Keith.