?
Solved

Basic Security for a form

Posted on 2012-03-15
3
Medium Priority
?
319 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 120

Accepted Solution

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

719 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