different users

spindar

New member
Local time
Today, 09:00
Joined
Jan 31, 2003
Messages
8
hello

I am making a datbase that controls a lot of results of our work. Now what I would like to do is to have a different switchboard depending on the user when they log in. All of our results need to be approved by a supervisor, so what I would like to do is have the button for the approval menu only useable by the supervisor.

So currently I have two tables one with the users and one with the supervisors. How can I make it so that the button is only useable by the supervisors?

Any help would be greatly appreciated.

Thanks
 
If you are on a network you can pick up the user name.

Then you can have a seperate form for supervisors and one for the workers. When they log in you can then check their name against a masterfile of users and open the appropriate form.

Col
:cool:
 
Ok I have two different versions of the switchboard, one with the button and one without. Would I use a command in the autoexec macro do enable the correct one?

PS I am rather new to using access.
 
Assuming you are using a network you can use this code;

I use a function someone gave me to determine the Network username from the Windows Registry. This works on Win98 and Win2k.
Go to the Modules tab, click on New. Paste this in exactly as written:

code:
--------------------------------------------------------------------------------

Option Compare Database
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As StringstrUserName = String$(254, 0)lngLen = 255lngX = apiGetUserName(strUserName, lngLen)
If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)Else
fOSUserName = ""
End If
End Function

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

Now you can use fOSUserName() (or as a control source, for example, =fOSUserName() )to stand for your user's login name to the computer.

It doesn't matter what you name the module when you save it. Only the function name matters.

Col
ps - thanks to David R for this
 
ok thanks for your help. I will give that a try
 

Users who are viewing this thread

Back
Top Bottom