How to create a password access within Database

it depends on how sophisticated you want to get. You could have a table of allowed users and your code could be

Button.visible =dlookup("username","tblAllowedUsers","username ='" & (Environ(“username”) & "'")<>""

I presume you have other security in place such as preventing users from viewing the navigation pane which would allow them to open the form just by clicking on it.
Hi CJ, thank you, your original snippet did the trick, and yes none of the users will be able to gain access to the behind the scenes of the database, they will only be able to see the form views. I like to the look of what you have just suggested and so I think I will test it out, thank you once again.
 
DlookUp return a Null if not found though?
Code:
? dlookup("FoodName","tblFoods","FoodID=500")
Null
 
A very simple solution is to have a stand alone app that just deals with employees. App is provided to only those who have network access, so you don't have to reinvent the wheel.

As soon as you add even one "Secure" page you will find it much easier to require security as Pat posted. One form leads to "Oh, now we need this report, now we need this other form, we need to track the following metrics, ect...

A separate application that has just the pieces management wants and that is secured by your existing network permissions avoids most of the headaches, at least during development.
 
Hi CJ, thank you, your original snippet did the trick, and yes none of the users will be able to gain access to the behind the scenes of the database, they will only be able to see the form views. I like to the look of what you have just suggested and so I think I will test it out, thank you once again.
Hi CJ, just had a thought as I'm currently developing this database on my home computer it will be deployed on my work network which is cloud based, so people have to log into the cloud to access all the companies files/folders etc. So will that snippet of code still work based on their login details to the cloud?
 
Hard coding user credentials in your form is just plain wrong.

You need to create a table of authorized users at a minimum and then prompt for their password in each form you want to secure. If you are going to go to the trouble to create the infrastructure to support using a SINGLE form, why not make it slightly more flexible so that if you have to secure an additional form, you can do it with NO MORE CODING. You just add data to a table as in my example. If you don't like my example, fine. There are others to choose from. My sample is just that, a sample as elemental as it can be to be functional. Using 0-9 as values is obviously limiting. Expanding to 0-100 makes it much more flexible. Adding a separate table to define objects rather than using the menu, adds more functionality (and more maintenance work because you have to remember to always add new items to the object table. Using the switchbboard items table makes it a no brainer if you use my maintenance form.
 
. So will that snippet of code still work based on their login details to the cloud?
Access (front end) doesn’t work in the cloud. It is a client based application. If by cloud you mean terminal server or Citrix which runs via Remote Desktop then each user has their own profile- so should work.

Each user has their own copy of the front end located locally to them- if you are thinking they will all use the same physical front end file, think again - it can be done but is guaranteed to corrupt at some point.
 

Users who are viewing this thread

Back
Top Bottom