Avatar of Tom Crowfoot
Tom Crowfoot
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Basic Security for a form

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?
Microsoft Access

Avatar of undefined
Last Comment
Tom Crowfoot

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rey Obrero (Capricorn1)

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
Tom Crowfoot

ASKER
Perfect as always - thank you very much
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck