Problem Please Read (1 Viewer)

adammorrisey

New member
Local time
Yesterday, 23:36
Joined
Nov 20, 2012
Messages
8
So I created an inventory management database, where a user has to log in with a password using a form, from there they can sign out or sign in a tool that is in the database.

I have a table EMPLOYEE - PK(EmployeeCode)
linked via a 1:M relationship
to a table SIGN_OUT - PK(SignOutID), FK(EmployeeCode), FK(InventoryID)
There is also an Inventory table but I can figure that out

I want to create a form that allows me to sign out a tool without entering the EmployeeCode and just extract the EmployeeCode from the user who logged in.

I know a simple way around it, but it would make the idea of logging in redundant if I have to use the username and password again

I'm not sure if this is possible within the limitations of Access since I have just started using it since September (when my course started).

Any help is greatly appreciated, I can provide screen shots or anything else that helps :)
 
Local time
Yesterday, 21:36
Joined
Mar 4, 2008
Messages
3,856
When you log in, save the login ID to a global variable (in a module). Use the contents of that variable in your SIGN_OUT form.
 

adammorrisey

New member
Local time
Yesterday, 23:36
Joined
Nov 20, 2012
Messages
8
I have never created a Module before and my experience with coding is pretty limited,
 

dstone10

Registered User.
Local time
Yesterday, 22:36
Joined
Nov 19, 2012
Messages
23
This would actually come in really handy for me in my application if you can elaborate George.

In my application I have two roles assigned to users. Admin and User. If someone logs in with the admin role I have a different form load than if a user role logs in because I could not figure out how to "save" the login information of the user to make the extra admin tabs visible or not.

If I could just make the tabs invisible by design and make them visible on form load IF an admin role logs in then that would be great. I could remove an entire form instead of loading two different forms.

I understand the code to make controls invisible/visible. Just not sure how to save login credentials to a global variable like you are referring to.

Also, will this method work if more than 1 user is logged in at a time?

Thanks!
 

Users who are viewing this thread

Top Bottom