deny some fields from some users

A

accessdesigner

is there a way to have some users gain access to some fields on a form and
prevent other users access to those fields from the same form based on their
log-in ids?
 
K

Keith Wilby

accessdesigner said:
is there a way to have some users gain access to some fields on a form and
prevent other users access to those fields from the same form based on
their
log-in ids?

Yes. In the form's Current event:

If CurrentUser = "whatever" Then
Me.Control1.Locked = True
Else
Me.Control1.Locked = False
End If

Keith.
www.keithwilby.com
 
A

accessdesigner

that's sweet! ... is CURRENTUSER an actual programming code that searches
for (reads) the actual user name? and do i use the actual user name in place
of "whatever"?
 
K

Keith Wilby

accessdesigner said:
that's sweet! ... is CURRENTUSER an actual programming code that searches
for (reads) the actual user name? and do i use the actual user name in
place
of "whatever"?

CurrentUser is a function that returns the name of the current Access user.
If you've applied security then this will be the user's account name. If
you haven't then it will be "Admin" and you will have to use the network
user ID instead:

http://www.mvps.org/access/api/api0008.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top