Solved

Basic Security for a form

Posted on 2012-03-15
3
307 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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

713 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