"charleythomas" <ch***********@gmail.comwrote in message
news:11**********************@30g2000cwc.googlegro ups.com...
Hi,
Allen Browne's "Field-level Permissions in Microsoft Access" (http://
allenbrowne.com/ser-55.html) is an excellent sample db i was looking
for a long time. Am using Access2000. I have multiple databases for
which i require different field level permissions. I will put my
question simple. Does anyone know how to modify this db in such a way
that i can specify the Windows User Name against the table fields to
block or unblock. I have an HR database used by approximately 15
users. There is a form with 7 tabs and hundreads of fields in the form
should have different Field-level Permissions according to users
Regards,
Charley
Store the user's network logon ID using this function to grab it:
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Function fOSUserName() As String
' Returns the network login name
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 = vbNullString
End If
End Function
You can also grab their machine name:
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Function fOSMachineName() As String
'Returns the computername
Dim lngLen As Long, lngX As Long
Dim strCompName As String
lngLen = 16
strCompName = String$(lngLen, 0)
lngX = apiGetComputerName(strCompName, lngLen)
If lngX <0 Then
fOSMachineName = Left$(strCompName, lngLen)
Else
fOSMachineName = ""
End If
End Function
HTH - Keith.
www.keithwilby.com