Solved

Basic Security for a form

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Refreshing a form in Access when saving data? 3 42
Run-time error '1004' after second execution of code. 4 37
ms/access ftp / SFTP 3 32
Search Form not Querying 2 10
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
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…
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…

929 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

14 Experts available now in Live!

Get 1:1 Help Now