Already chosen entries in a dropdown menu shows name (Access 2016) - ms-access

I'm creating an Access application that improves the workflow of our book fair at our school. One of the features is the locker management since that's a part of the school bill.
I have made a dropdown menu with all the lockers and restricted it. I placed an index on it and disallowed duplicates.
Now, is it possible to hide the already chosen options? For example, if locker A001 has been chosen, that when you go to the next student, you are unable to even SEE the locker A001, because it has been selected already? Or alternativally, that the name of the student that already chose that locker is shown.
EDIT: Yes, I could ask the sql code but I would also love to know how to implement this in Access.
Thanks in advance

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?

How to insert entries from a user perspective

I want to build a small Access database to better keep track of the companies we are looking at. I read Access 2010 Inside Out by Conrad/Viescas, did a lot of their examples and had the feeling I understood the basics, so I started with my own data base. Now the struggle begins, I think I have a basic misunderstanding here.
The relation I started with is quite simple: Each company we look at can have listed peers that we want to use to compare this company to. Of course, each company can have many peers and each peer can be the peer of many of our companies. So I modelled this relation as a many-to-many relationship:
Next, I created the form for a company, which looked something like this:
I related the subform I used to show the peers with a query that is based on tblPeersCompanies_1 and gives some additional information. What I now want from a user perspective is straightforward: A user should simply add peers to this subform for the company he is currently viewing. Access should then automatically update tblPeersCompanies_1 and tblPeers_1. The peers really serve no other purpose than to relate them to a company.
However, I struggle implementing this. Adding a new peer to the subform does not work, simply because it is not based on tblPeers_1 and if I enter the information there, Access notices that the peer is not in that table yet. (That is at least what I think the problem is). How can this be achieved though? I don't want the user to open another form, enter the peer first, go back to this form, type the peer again and the other related information. I hope that there must a simple way to do that automatically. Or is this indeed not so simple.
In summary, the question probably can be phrased as: "How to add records to a matching table and a related one-table on the fly in a form?"
Thanks to the great comment by #Remou, I found a solution to this problem. It contais three steps:
Use a combo box as outlined in another SO post
Use this function to automatically enter new records in case the peer is missing. Call this function in the "On Not in List" event
Show other values from tblPeers by linking it to the selected value in the combo box, as explained here
I have to say, this is much harder than I hoped it to be. Let's hope that the learning curve is steep and that it will at least be easy to use for the user and quite robust.

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

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.

Storing and retrieving users shopping cart from database - Cart class - CodeIgniter

I haven't started the coding yet and really just want to get feedback on my ideas.
I would like to know how to store a users shopping cart contents in order to be able to retrieve them once they have returned to the website.
I'm confused with the idea of allowing users to create accounts, as I've read on this website that forcing people to create an account with you in order to put items in their shopping basket is bad practice. However, if I do give the ability to have an account, then I can create a table holding the accounts information, along with having a column for storing that users shopping cart content via the CI Cart class' function $this->cart->contents; (which I would then have to serialize before putting it in the table, right?).
I also wanted to know if it is possible to store the contents of a users shopping basket into a column as stated above, and then retrieve it back to display as the users shopping basket contents once they log back in.
Having an account would benefit in terms of having your shopping cart items available in different browsers, as they would be associated with the account and not your session.
But if I don't want to implement customers having accounts, do I just have to implement the Cart class, with no interaction with the database (and just setting the session variables in the config file to not expire, or expire in a year etc)? I don't understand why I would need the ci_sessions table in this case (any arguments for using it?)
Really confused because I've pondered over this for a long time, getting more confused as time goes by :(. Could someone please shed some light for me. Thanks
I think its always a good idea to get customers to create accounts because
Its a good way to stop span. Only allowing registered and logged in users to access the checkout stages is a lot better than just letting anyone get to it
Its also a good way to gather information about your customers that can be used for marketing
In regards to the cart you can save sessions to a database by making sure sess_use_database is set to true in the config files
$config['sess_use_database'] = TRUE;
That way you can add the customer previous items into the cart when they log back in.
But I agree with #dispake you've asked quite a lot of questions so its hard to give you a definitive answer

Creating a graphical representation of connections in Microsoft Access

I have another Microsoft Access question:
I am building a contact database, and some of these contacts have relationships with each other. For example, two contacts in the database might be brother and sister, and I will have marked their relationship within the database accordingly. I can generate a report with SQL that will give me the information that I want (i.e. who is related to what person). However, the problem is not the information itself, but how I would like to display said information.
Instead of a list format detailing every contact somehow related to the person in question. I would like to graphically represent a web of people. So if John Doe is the brother of Scott Doe and a sister of Jane Doe, then the Access report would have John Doe's name in the middle and then two lines coming out of the name pointing to Scott Doe and Jane Doe.
I am not even sure if this graphical representation is possible in Access, which is why I'm curious to know if anyone has ever attempted this before or if it is even possible. And then, how would one go about setting that up programmatically?
I realize that this is a fairly open-ended question, but any help would be much appreciated. For the record, I am proficient in VBA.
You could consider introducing a treeview control. And since you don't know how many levels, then in our industry, we typically use what is called recursion.
There is an example here of code to fill the treeview:
http://support.microsoft.com/kb/209891