login page

Johanvdw

New member
Local time
Tomorrow, 01:26
Joined
Jun 23, 2025
Messages
9
Guys, thanks to a member (charles), who helped me developed a nice delivery note system, I would love some help to add a login system to it. When an employee are logged in, his credentials(username, tel no and signature) must automatically added onto the reports(Delivery note & gatepass). Can somebody help me with this?
FrmDelivery.jpg
tblEmployees.jpg
RptDelNote.jpg
 
Here's a sample Switchboard with simple security.


If all you want is the login, you don't need to worry about the other stuff.
 
When an employee are logged in, his credentials(username, tel no and signature) must automatically added onto the reports(Delivery note & gatepass).

Rather than closing the login form once a user has successfully logged in, hide it by setting its Visible property to False in the form's module. You'll then be able to reference controls in the login form from other objects. In the attached little demo file the user logs in and enters a hashed password. If they then open either of the bound forms their user name and permissions to the form are shown in unbound controls in the form header.
 

Attachments

Guys, thanks to a member (charles), who helped me developed a nice delivery note system, I would love some help to add a login system to it. When an employee are logged in, his credentials(username, tel no and signature) must automatically added onto the reports(Delivery note & gatepass). Can somebody help me with this?View attachment 121852View attachment 121853View attachment 121854

Do your employees each work under a unique network login? If so, just grab that information and put it all in a table with various other attributes as needed. Then use (any one of multiple methods) to get their logged-in network username at runtime and look up their permissions from the table. such as Environ(username)
 
Rather than closing the login form once a user has successfully logged in, hide it by setting its Visible property to False in the form's module. You'll then be able to reference controls in the login form from other objects. In the attached little demo file the user logs in and enters a hashed password. If they then open either of the bound forms their user name and permissions to the form are shown in unbound controls in the form header.
I just used to store static information like that in TempVars() for further use in the app.
 
Ken's reply makes sense as it is functionally the same as creating a login class (for those with long memories you'll remember using hidden forms as classes in Access 95 before they were formally introduced into Access). I always do this in a class I name 'ThisApp' which contains everything I need to have 'on-tap': often only one or two items but usually a range of them.
 
Do your employees each work under a unique network login? If so, just grab that information and put it all in a table with various other attributes as needed. Then use (any one of multiple methods) to get their logged-in network username at runtime and look up their permissions from the table. such as Environ(username)
Giant benefit to using the OS login is you don't have to develop security. You have a major corporation working out how to keep your system safe.
 
Giant benefit to using the OS login is you don't have to develop security. You have a major corporation working out how to keep your system safe.
Thank you! Exactly. Same story as 'backups' concerns. If you work in any company with major systems like network logins, as well as file server backup schemes, or SQL dba's, some of those concerns really aren't yours, they're a dedicated team apart. Giant benefit for sure
 
It really depends on what your requirements are. You can use Environ("UserName") to pick up the name of the user logged in to the PC. If that is good enough, then, they're all correct. No login process is necessary. You just use the "UserName" to track who is making the change.

If your requirements are more specific, then you may need something similar to what I posted. It allows you to control access to a specific Access FE and within that you can control add/change/delete/view to specific forms. My sample, works using the Switchboard Items table and all subforms on a main form use the same privilege level as the main form. If you need something different, you will need additional tables to manage the specific privileges for forms/people.
 
Rather than having users remember another login, simply ask Windows who is logged in (see code in link below). This is assuming that each user has their own login.

If you are also on a Domain network, you can use the techniques and code I wrote about here to provide group-level security, so different groups can have different levels of access in the application.
 
You can always use the Environ() function to obtain the account of the logged in user. That is separate from whether or not you need to define permissions tables in your application. In my applications, the admins define the login ID which will almost always be the same as their windows ID. I give them the choice but they seem more comfortable with the second login. Then the user can decide on what to use as his own password. When an admin defines a new user, the default password is "password" but "password" is an invalid value for the password so it can only be used to log in once to get to the change my password screen. Once you have changed your password, "password" never works a second time. The app password can be the same as his Windows login password or different. User's choice.

If you wanted to use the Windows login and so wanted to suppress the Login form, you would add code in the Current event of the form to automatically populate the userID and not require a separate password but just continue silently with only the populated userID. That collects the security permissions you have defined and leaves them active in the hidden login form. So, you get a "silent" login but you still have internal permissions for various app functions.
 
Do your employees each work under a unique network login? If so, just grab that information and put it all in a table with various other attributes as needed. Then use (any one of multiple methods) to get their logged-in network username at runtime and look up their permissions from the table. such as Environ(username)
Yes they do. I will have a look at it. Thank you
 

Users who are viewing this thread

Back
Top Bottom