Limit access to a database to a few users. (MS Access 2007) - ms-access

I would appreciate if someone would help me with this.
I am new to Access and my boss has given me a project to create a tool for our team (I work in insurance). I'm done with most part of the project, but my boss wants editing and updating of database restricted to a few members of our team (yes more than one person can modify) but since the tool is to be used for a wide range of purposes, she would like that the rest of the department (50+ people) can only access certain forms which have buttons etc. that do the job.
So far in this database I have, 3 linked tables (which hold all the data), queries, reports, union queries and make tables and 3 forms. What I would like is for most people to only view forms and use it in form view only, but 4 members of my team to do whatever they want since they need to constantly edit the data.
Does anyone have a hint about where I should begin? Programming is not my cup of tea so I would really appreciate some reference etc. or any help!

If you hit file, then hit options, and then select current database, you can force a specific form to pop up whenever you open the access database. In addition, you can take away the user's ability to go through the entire database's content. you can also take away the navigation bar and menus and such. I have been doing this for a while, so here's some advice. Have a main menu form that has a button for every form in the access file. When the user opens the database, he or she should see that main menu form. From there, they can click on the button that will lead them to the form that will solve the needs they have.
Stackoverflow won't let me post a comment, so here is what I was going to say. For those who you want to have access to it, you can have them hold shift while opening the database. If they do that, they will open the database like they were an "admin" to the database. They would be able to edit it however they would like if they hold down shift.

I have done this via a table, assigning users a specific "Security Level" and checking their security level via a login screen. I then hide the login screen (not close it) so that anytime a form is open it can do a DLookup of the user's security level and then determine if the user has read, write or read/write access to the form. I can also hide buttons on the form based on the same logic.
Starting in 2007, Access removed their native security, which was pretty inefficient anyway.

Related

Microsoft Access: using passwords to set different permission levels

I am a teaching an IT course to 15 year-olds. Part of the course is an assignment in which we create basic relational databases using Access. I have a beginners level knowledge of Access (it is not my background) and the students are not expected to use VBA (it is far beyond the scope of what we cover in the course).
The examining body has asked the following:
The database will have a table with some basic student data (name, age, exam score etc). We will create a form to view/edit/add etc. But we are then asked to implement some functionality so that one password ("password1") only grants Read-Only access to the system but a second password ("password2") grants full editing rights.
I have seen some very complex solutions to this online, but nothing that is appropriate for the level of students this course is aimed at.
As this is an educational setting we don't need to be overly concerned with the actual integrity of the system (it's just a basic course) and VBA is not an option.
Is there an option that will allow us to have a login screen that takes users that enter one password to a Form with editing options disabled, and if the other password entered they are enabled (and I just hide the table from view... remember this is basic)?
Thanks, sorry for such a basic question... bear in mind this course is being discontinued in 2023 ;)
Since you are not using VBA I assume that you are using macros to open forms, etc.
You can open a form in read-only mode with the action OpenForm by setting the Data Mode to Read Only.
If you want to disable buttons in the form you just opened, you can execute the action SetValue with Item = [Forms]![frmSelect]![cmdSelect].[Enabled] or Item = [Screen].[ActiveForm]![cmdSelect].[Enabled] and Expression = False. (I assume that the form name is frmSelect and the button name cmdSelect.)
The VBA equivalent would be:
DoCmd.OpenForm "frmSelect", DataMode:=acFormReadOnly
Forms!frmSelect!cmdSelect.Enabled = False
In older Access Versions (< 2007) a completely different way is to use the built-in security system (which I don't like). See: How To Manage User Permissions In Access Database?

Microsoft Access subform as a sandbox before actual updating of the data

I have an Access 2013 DB with 2 subforms: The first one provides current data and the second one I'm trying to set up as a sandbox space for users to make changes and updates at their leisure. When they are ready to submit those changes and updates they can hit submit and their results will update the current data and table info behind it.
Been a while since I've messed with Access so I can't recall if this can be done so thought I would ask.
It can’t be done without a rather messy approach. Forms in access ALWAYS edit ONE row.
What I do in these cases is allow the user to “edit” as much as they please.
However, say we are doing a “classic” check or donation amount enter. So you have a donation amount (say $50), but you THEN have to distributed the amounts to various donation accounts.
With the above, you don’t want to save the data until such time that the amounts distributed to accounts match the donation amount.
Because we can’t contain the form + sub form as a “single” update, then what I do is add a posting flag to the parent form (the one record in the main form).
The user can then edit/add, go away for coffee, and come back and edit some more. You can even come back the next day and continue editing.
Once the user is happy, then you have a post button on the form.
If the user hits post, and the balance amounts don’t match, then you don’t set the postOK flag = true.
The above will thus NOT provide a means for the user to bail out, or un-do their edits to the “whole thing”, but it does allow you to determine that the data entered has been “balanced” and verified. And if the “balance” did not occur, then you can skip that record, or introduce a process in which the data is not posted or marked as done until such time that the data balances.
Here is a screen shot in Access of a “classic” money distribution to several accounts. You can see the donation amount on the left side, and on the right side is the account distribution of that amount.
However, at the bottom of the screen, for the “job task” the user is working on also has a post button. When they hit the post button, if the amounts don’t balance out, then the posting is NOT yet done. In fact, I let the user enter "many" donations, and then they can "post" all at once for ease and speed of working. The "post" does NOT actually post, but checks the balance. So users "think" they are posting, but it only really ever sets one value (a flag POSTOK).
So to run a report, it can’t be run until such time that the post button was hit.
As noted, this approach will NOT give you a “bail out” option to exit your data entry, nor does it allow you to “undo” the data entry, but it DOES allow you to verify the posting is “ok”, and “valid”. In many cases this approach will suffice.
However, if you looking for some kind of “undo” for the form + sub form edit, then Access quite much is not the correct tool for that type of business model and edit.
I would suggest you set up a local temp table for the sandbox.
Then when you say 'When they are ready to submit those changes and updates they can hit submit and their results will update the current data and table info behind it.' ….. instead what happens is the Sandbox Temp table record appends or inserts/updates the actual table.
If this is a split multi user app and the Sandbox temp table is local - then the data is indeed temporary and the update must occur within the user's session. But the overall design is quite simple.
After finally getting back into this I realized I was looking at Access development through the eyes of how I would do it in Excel; both different ecosystems. I took off my Excel forms dev lens and a few things occurred to me that I think may help others with similar struggles:
Access and Excel are different VBA development ecosystems. You can’t necessarily code it in Excel and expect it to work flawlessly in Access.
A subform is just a form...and like all forms its controls, code, and behavior don’t change in functionality but in presentation based on form type (datasheet, continuous, etc).
Treat each Form and event code independently of each other. If your subform on a parent requires events to kick off when a user adds, updates, deletes, validates, etc. that code should belong in the form that makes up the subform.....not the parent.
The parent form should only control filtering and results from the subform as well as it’s own set of actions the user has.
The Screen method is amazing and one I think would have saved my life for tracking changes. Great link here: https://www.datawright.com.au/access_resources/tracking_data_changes_in_access.htm

Trying to write to one table with multiple forms in Access

After searching around the forums I can find multiple issues with having several tables and one form, however I have the inverse problem. I have four separate forms that are all linked to the same table. No two forms edit the same variable on the table.
If people open up a single form, save it, close it, then move on to the next form the database works as intended. However, some people open up all the forms and forget to save/close the one beforehand. At this point, Access refuses to save the file stating that 'Another user has this file open' since the table is open in another form, even though no variable should overwrite each other.
Is there any workaround for this? I'd just like to have people be able to save their entered data from several forms to the same table. There will be no point in time that two people would access this table simultaneously, I just want to make sure we can save the data if someone opens multiple forms at once.
First, in a MS Access database multiple users can have same forms open. The only Read/Write issue would occur if users are working in the same record. Whoever enters the record first and begins updating would have the record-locked for him/her and users afterwards would get the warning message until the record is saved (or dirty event is removed). Users may be able to view but not be able to edit.
So your issue may be more an operational than a programming one. Try to organize users to manage specific records at a certain time or coordinate add/update work between team members. Of course this would be impossible if you run over a large company network with hundreds of users or online.
Still another solution would involve migrating all separate forms as subforms into one main form, so all corresponding records align at same time. But normally, subforms are reserved for join tables and not same table record sources. You can use tabs if space is an issue. This does not stop the record-locking issue but at least reduces the chances of it since less records are spread across separate objects. In fact this may prove to be better as users can move back and forth to other variables of the same record for reference on one form instead of opening/closing other forms or keeping the other ones opened.
Finally, it is highly advised if working in a multiple user environment and especially since you are connecting ODBC to systems like MySQL to split your database between FrontEnd (linked tables, forms, queries, macros, modules) and BackEnd (only tables). This setup prevents corruption, efficiently runs systems as only data is sent across the network and not whole application items, and overall fosters a better multi-user environment. Each user can have a copy of the FE on their local machines but all will connect to one BE on a shared network. To help, Access 2007-2013 has a button for this on the Ribbon under Database Tools.
I've used a dashboard that displayed buttons to open the forms needed and then used yourform.showdialog() to open up other forms in C#. This will make it so the user cannot use other forms until the form that is open is closed.
http://msdn.microsoft.com/en-us/library/39wcs2dh(v=vs.110).aspx

ExtJS - editing calendar events

I'm working on the admin panel of a project using ExtJS, and there I have a Panel, CalendarEvents where data for any upcoming events should be added, deleted and of course, edited if need so.
The problem is that the people who are going to administer this admin panel won't be people with computer education, and when they insert data for a new event or change the data for an existing one, there must be an easy to understand interface to do that.
They must be able to add the time of the event, as well as the date, and it makes it even more difficult, at least for me, to think of a way to provide these functions. Until now, we've been using double click and editing the info manually by writing in the cell, but this is going to bring a lot of problems with the right date/time formatting.
So, I'm looking for a good way to implement this option in my admin panel.

Editable Form and save changes

I'm hoping this isn't harder than it seems.
I want to create an HTML form with a few text boxes that will allow people to enter in some data and I want these changes to be saved to the form.
For example, if my html page says:
Name: [ ]
...I want someone to be able to click on the [] and enter their name, etc. and click SAVE
and then have the form say:
Name: "Name of Person"
If someone wants to update that, they can click on the person's name and change it and click SAVE and have the HTML form update itself.
How can I do this? I've looked everywhere and people are talking about HTML5 AND PHP. Is it really that complicated to make a simple page like this?
(In case I wasn't clear in my html I'm using the contenteditable="true" option. How can I save those changes?)
I think your question indicates that you don't already know that web pages (including forms) are "stateless", meaning that they do not "automatically" hold or store anything that you do with them. Sorry to disappoint, but as a beginner you will struggle to find "an easy" solution to this.
That is not to say it can't be done - you no doubt see it everywhere - but your level of knowledge misses the fact that you need to actually program the logic to determine how your form will "appear" to store the information and reproduce it on a later visit.
Here's a (really) brief summary:
When your form is used by your user, a couple of things have already taken place before they get to see the form:
the user has requested the page (typing a URL or clicking a link)
the web server has sent the requested page (that is; your website has sent the form)
The next thing that takes place is that your user enters some data on the form. This data is not stored anywhere - if you refresh the page the data is gone, because steps 1 and 2 happen again.
So to avoid this you can use a number of tools:
Javascript: this operates on the user's computer. You can use it to find out if something has been entred on a form, and store it in, for example, a cookie.
Then you will have to build some logic into your page that says, "if my user refreshes the page or comes back to this site at a later date, then look for the cookie. If it exists, then take it's values and pre-fill the form, before the user gets to see it."
Server Side Script: This logic can be built into your web server (using a server side script like PHP) so it actually runs in step 2.
Alternatively you can build it into a javascript function which fires when the page is actually received by your user. This would be a step 3.
A second alternative combines these two ideas (processing on the user side and processing on the webserver side) called AJAX, which basically means that the "discussion" between your javascript and PHP takes place "on the fly" when the data is entered or changed.
And lastly you might want to consider PHP Sessions to store data, and/or a mySQL database. Recently with the advent of modern browsers you now have the possibility to store the information in a local database available to your user's browser...
In all of these cases you will need to learn how these pieces talk to each other, how you retreive the information, and how you update your stateless and static form.
It isn't has straightforward as you might think...
You don't need HTML5. HTML4 is good enough :)
But you need some server side script that saves the changes (on the server side in e.g. a DB or XML file). To make it a better experience (if multiple users use the form at the same time) I suggest you use AJAX to save the changes and poll the server for updates.
This is not complicated (at least I don't think it is), but it seems to be a generation ahead of what you already know. And it could take quite a long time to get the structure in place before you can do this sort of thing without needing help.
There are some basic questions
Does the information need to stay saved when the user hits reload?
Does the information need to stay saved when the user clears cookies?
If the information can be blanked out next time they come back to your page, then it is simple.
Otherwise, we need a way to keep track of which user sees what information, so the guy in Texas does not see the information the guy in Chinatown typed in. Cookies are a common way to do this. You could save the information to the cookies if there is not too much information.
Otherwise, you need sever-side language. This is usually in PHP, but deciding what language has to do with why you want to learn in the first place? Are you wanting to work for a company later on? Do you have your own website?
Please comment to let me know more what is going on, and what the answers are to the two basic questions, and I will better be able to answer.
Usually, for most cases, there is a login name and password (or OpenID), and if cookies are cleared, the user logs in again, but this requires some work to set up a working login before you re-visit this question of how to store what they type.