Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I limit view of certain form fields for certain users in Access

Status
Not open for further replies.

corbitt

MIS
Feb 22, 2002
73
US
I built a simple, one-table database that contains login & password information. The form lists the user's name, address, password, etc. My boss would like to exclude the password form field(s) for certain DB users.

I thought about creating a second form that does not included the password field for those certain DB users, but I believe my boss desires a long-term approach.

Any suggestions would be appreciated.

I'm using Access 97.

Thank you,

Jeremy
 
The following code returns the network log on name

once you have a user name you can then set the controls visibility based on who they are.

hope this helps

---------------------------

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long


Function fOSUserName() As String

Dim lngLen As Long, lngX As Long
Dim strUserName As String


strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)

If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = &quot;&quot;
End If

End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top