Password protecting multiple forms

Epi

Registered User.
Local time
Today, 13:34
Joined
Mar 23, 2011
Messages
26
I need to password protect multiple forms that are all on one database. Each form needs a different password. My programming skills are minimal so if someone could write a step by step out or direct me to one that is already written then I would appreciate it greatly :D
 
I need to password protect multiple forms that are all on one database. Each form needs a different password. My programming skills are minimal so if someone could write a step by step out or direct me to one that is already written then I would appreciate it greatly :D

I dont know what your reason is for this but, you should be aware that anyone with access to google would be able to bypass that in a second.

Disable Shift, F11 etc. This will help a little.

Someone with more exp will need to help with the code side.
 
The form I am making is replacing a paper form used in a large organization. The password protection is just so people in some units don't try to put false information in other units. Basically the jist is each unit will be able to use one form and not get into anyone else's.
 
Are we talking about the data that the form displays that needs protection? In other words users can only see their own work and not others.
 
Are we talking about the data that the form displays that needs protection? In other words users can only see their own work and not others.

Umm I think so. The ideal situation is people from unit A would only be able to access the unit A form and not the unit B form etc. The Access database/form will be on the server so everyone can get on and put in what information they need to in their unit's form. Password protection for the forms is the only way I see to go about this.

The place I'm interning at has an issue with unit B wanting to make unit A look bad and so on and so forth.

I already know how to password protect the entire database so that isn't the issue. I just have no idea how to password protect the individual forms.

Thanks for any help y'all can provide!
 
That's fine is the information collected the same for both units? By that I mean the fields in the same tables? If so, when you savea record you save which unit generated the record and only allow Unit A to see Unit A data, like wise for Unit B.
 
As vapid mentioned earlier it's relatively easy to bypass security, unless you've been REALLy thorough and caught all the possible ways they can be got around. My method would be to make MDE files containing just one form and send that out to the relevant department, password protected. Access's own security is tougher I think, and as an MDE there wouldn't be an opportunity to look at any of the tables behind the form.
 
That's fine is the information collected the same for both units? By that I mean the fields in the same tables? If so, when you savea record you save which unit generated the record and only allow Unit A to see Unit A data, like wise for Unit B.

Yes it is the same exact information. The forms will look pretty much identical.
 
As vapid mentioned earlier it's relatively easy to bypass security, unless you've been REALLy thorough and caught all the possible ways they can be got around. My method would be to make MDE files containing just one form and send that out to the relevant department, password protected. Access's own security is tougher I think, and as an MDE there wouldn't be an opportunity to look at any of the tables behind the form.

Problem is I have no idea how to do any of this. I'm an epidemiologist not a computer programmer by any means.

I'm not really worried about the system being hacked and people finding ways around the passwords. I don't think that will be much of an issue. But I do need some semblance of security so it isn't so easy to really mess up another unit's data.
 
Then you need to look at creating a user login form if you do not already have one, and capture who is logging in, this will enable you to detect which Unit they work in and restrict their viewing caperbilities to their data only.

To do this have a table of users that holds their name and password and which unit they work in. You also need to consider what happens if a certain person can see more than one units data.
 
Then you need to look at creating a user login form if you do not already have one, and capture who is logging in, this will enable you to detect which Unit they work in and restrict their viewing caperbilities to their data only.

To do this have a table of users that holds their name and password and which unit they work in. You also need to consider what happens if a certain person can see more than one units data.

How do you do this though?

It doesn't matter if they see the data already generated. Everyone will see the results in a monthly report and the data isn't of confidential status at all.

I just want one database to be on the server and a person out of unit A can get on it and only be able to login to the unit A form. If they try to log in to the unit B form then they will not be able to get in because they don't know the password/username. That sort of thing.
 
I thin kif it's only two departments it'd be easier going down the MDE route... just create one database with the form (if they're both identical) and a link to the table on the server. Base it on a select query that says "select all the fields from your input table where "Unit" is A". In the form's on current event put
Code:
If Me.Newrecord then
[insert name of unit field here].value = "A"
Endif
Save the database. Make a copy, change the A's to B's. Password protect both, look up "Create MDE" in Access help and job's a goodun.
 
But why have to identical forms that reads the same underlying data? How many units are they? The more the units the more the forms you need. The more you have to ensure that all the forms are sync'd up if changes are made to the forms.

Can you trust a person from Unit A not telling a person in Unit B what the password is? Do you have a way of being able to identify which data belongs to which unit?
 
True, I did ask about the number of units but if it ever changes it'll be work... And passwords are only as safe as the person who knows it is trustworthy, I guess.... :)
 
I thin kif it's only two departments it'd be easier going down the MDE route... just create one database with the form (if they're both identical) and a link to the table on the server. Base it on a select query that says "select all the fields from your input table where "Unit" is A". In the form's on current event put
Code:
If Me.Newrecord then
[insert name of unit field here].value = "A"
Endif
Save the database. Make a copy, change the A's to B's. Password protect both, look up "Create MDE" in Access help and job's a goodun.

It is about 50 departments that would each need their own form. Kind of a large organization. :o I will play with that though and see if I can get it to work.
 
Erm, if it's that many I wouldn't - go with DC's suggestion!
 
But why have to identical forms that reads the same underlying data? How many units are they? The more the units the more the forms you need. The more you have to ensure that all the forms are sync'd up if changes are made to the forms.

Can you trust a person from Unit A not telling a person in Unit B what the password is? Do you have a way of being able to identify which data belongs to which unit?

It's military so keeping their passwords to themselves shouldn't be an issue (hopefully :rolleyes:). The forms haven't changed in a good while. I'm just making them paper-less instead of paper-based so it will help out the office I'm working for greatly. They won't have to enter each data point into an excel file. This will make it a whole lot easier hopefully.

I don't have a way yet. Still working on it and testing out example files to try to figure this out.
 
So lets go down your route.

You create 50 identical forms, the only difference is the form name.
How are you going to construct you menu to determine which form to open?
How are you going to validate the users input?
How are you going to restrict the data in the form to match the password?
How are you going to manage the passwords?

This should keep you going for a bit.
 
Constructing the menu should be easy. They open the access file and click on the form corresponding to their unit. They know this by the form name.

Maybe the best way would be to have a central database that collects the automated ID and then those go to another database for each unit which has its own form. I have no idea if that is possible but we can go theoretical for this for the moment.

I don't know how to do the passwords. That's my big problem. The rest I can play with and figure out but the password deal is the big issue. The username/password should be about 1-5 for each unit. It will probably be one username/password but I haven't gotten that far with my preceptor to figure that out. I just want to know how to do the password in the simplest way.
 
All you really need, like DC was saying, is a table with UserID, Password and Unit. Create a form based on that and put something like this in the code for the login button:
Code:
Dim varunitnumber as integer
If me.txtpassword = dlookup("[Password]","Users","[UserID]='"&me.txtusername & "'" then
VarUnitNumber=dlookup("[Unit]","Users","[UserID]='"&me.txtusername & "'"
Docmd.close acform
docmd.openform Yourformname here,,,"[Unit]=" & varunitnumber 
Else
msgbox "Invalid Username/Password"
Endif
Easy if you can trust people not to muck about behind the scenes. Obviously txtpassword is the password text box on your login form and so on.

It's also possible to do things like hide the database window and toolbars so users can't see the base table or toggle the filter off...
 

Users who are viewing this thread

Back
Top Bottom