Unanswered: How to get and store ID and PW from a form at program open
I have a chem lab Access database that does not need serious security, but rather minor security. Currently, it is set that when a form opens that needs security, a box opens with a spot for Login ID and Password. If the two match an entry in a table and their security level is enough (user, supervisor, or admin), then the form opens showing only that user's information.
This has worked fine for now and has allowed the database to be used. However, I am now in the fixing up process and would like to streamline the login process. Instead of having a person log in each time a form is opened, I would like to have the login screen come up after the program opens, then after the ID and PW are entered and cleared, the program will store the ID and make the menu items he or she has access to the only ones available. When a form is opened, it will list only that person's info.
I'm pretty sure that this involves using a module, but I have never used modules before (self-taught Access user). I think what needs to happen is that the ID number needs to be stored for future reference, then my forms would just retrieve that ID and display the correct info. I have Yes/No boxes for each security level, so the code would reference that and only make the appropriate menus available, but I'm not sure how to do that either. Any help to get me in the right direction would be great. If more info is needed, let me know.
you can get the user to log on, and store the userid or security in a global variable.. or use the currentuser() function if you get the user to authenticate on first opening the Access db.
have you considered by passing the need to request a user id, and instead pull the userid from the network user.. its not appropriate for all cases.. but can save a fair bit of effort. have a look in the code bank or look for Dev Ashish's API calls on google
Using the network ID would work if there weren't shared computers where multiple people are working on one computer (these are QA labs). I'll look into using what you suggested. May take me awhile to figure it out, but if I do, I'll post the result. Thanks again.