Solved

Basic Security for a form

Posted on 2012-03-15
3
303 Views
Last Modified: 2012-03-15
Dear Experts,

I have an access 2010 database which I only want certain people to have access to, but I dont want to password protect it for a whole host of reasons.  I know that whatI am going to ask is not the most secure method but its the solution I need to implement ...

The database has a module to get the user's Network Login Name and is accessed with =GetOSUserName().  

On opening the form "Welcome" I would like the database to lookup the Network Login Name in the table "Permissions", if it finds a match in the field [NetworkLoginName] then the form just opens normally.  If it doesnt then it opens another form called "Access Denied" and closes the form "Welcome".

Can anybody help?
0
Comment
Question by:correlate
  • 2
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 37724694
in the opeen event of form "welcome"

private sub form_open(cancel as integer)

if nz(dlookup("NetworkLoginName","Permissions","NetworkLoginName=" & chr(34) & GetOSUserName & chr(34)),"")="" then

cancel=true

end if


end sub
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 37724699
private sub form_open(cancel as integer)

if nz(dlookup("NetworkLoginName","Permissions","NetworkLoginName=" & chr(34) & GetOSUserName & chr(34)),"")="" then

msgbox "Access denied"
cancel=true

end if


end sub
0
 

Author Closing Comment

by:correlate
ID: 37724703
Perfect as always - thank you very much
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now