Are the barcodes always unique per person?
The bar code scanners have nothing to do with login process. The barcode readers are being used for production line to input Order No, Customer ID, Quantity, etc. I mentioned it just to clarify why some PCs are shared. These PCs are connected to Laths, Fraise, Grinding machines etc. And MUST be shared between the personnel who use those machines.
If you use a "switchboard" or "dispatcher" style of form, where you click a button to do a function, then at user connection time, you could make that switchboard smart enough to turn on or off the buttons appropriate for that user. Then allow the switchboard to bring itself to the rear so that any other form is on top. But if the switchboard never exits, you can keep the user ID in that form. At least for the forms where the decision is use/not use, that is really all you need.
I have a switchboard, but it's impossible to make it smart enough to do what I want. The database has 164 forms and 50 reports and 86,000 lines of codes. I have 6783 controls on different forms with a ribbon that is made of a xml file with 968 lines. All of these forms/controls & ribbon controls should be controlled per user. No matter how the switchboard is smart, it will not be able to control the database.
I know my English is not that good, but I was sure what I asked for is clear enough. But it seems I was wrong.
The system I have, works perfectly and everything is under control. The 86,000 lines of codes are managing just OK. Every user logs in with his/her username and password. His/her user ID is saved and anytime he opens a from, the form's on-open event gives him the permission he has. some controls get hidden, some are disabled, and he gets the edit or read permission for several fields.
I thinks things got mixed up in the middle of the way.
As my first post in this thread says, I'm not asking how to login or how to get permission per user etc. I only wanted to see
how other programmers keep a track of a successful login to refer to it in later use.
Let's keep everything simple and clear.
A user logs in. He opens a form and edits a record. The form sets the LastEditBy field to the ID of the user.
Well....How do you understand who is the user?
This was my main question.
At first I was using a global variable to keep the user ID and use it in these cases, but recently I changed it to tempvars. (thanks to DBGuy).
I was asking how many other ways are possible.