Need a code where file only opens if user is f.e "john"*7152008

J

J.Alladien

Dear All,

I need a code where a mdb only opens if user" john" is logged in, if f.e
user "patrick" is logged in i would like the database to display a message
and then automatically close. Please note that i already have a workgroup
with these members so it's just about the code!
Thanks in advance!
 
D

Daniel Pineault

You need only use the CurrentUser method to check who the 'current user' is
and then act appropriately. Try something like:

if currentuser = "john" then
Application.FollowHyperlink "c:\Path2YourFile&FileName"
Else
MsgBox "You are not authorized to perform said action",vbCritical,
"Unauthorized Access"
Application.Quit
End if
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 

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