IF THEN - Hide toolbars for users

halljkl

New member
Local time
Today, 13:02
Joined
Feb 6, 2008
Messages
2
Hello,

I have made a form for entering suggestions, what I want to happen is if I open the form I can see all the toolbars, design view etc . . .

but if another user opens the form all information is hidden.



Also if possible when user "cornsg" opens the database I want that user to be shown a different form to everyone else opening it.

I have set it up so when the database is opening it auto opens a form that says welcome then after 5 secs opens a form that users imput data.


Any help will be really appreshicated please reply / email me lewis.hall@inbox.com


THANKS GUYS
 
Do you have user level security on the db? If so you can use the CurrentUser() function to retrieve the user name of the person logged in. If you dont have User level security yoiu can use Environ("Username") to retrieve the name of the user logged into windows. From there you can determine which toolbars and form you need.
 
Hello,

I started to use the security on access but it only asked for a username when you open the database, I want it so that it looks at the username eg "lewis" and determins yes he can see toolbars but anyone else cant.

Ive got a module set up




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 = ""
End If
End Function





and in the text field I have =fOSUserName()




So how can i make access say yes user X Y Z can see toolsbars but others cant

Thanks for the quick reply
 

Users who are viewing this thread

Back
Top Bottom