User login page which counts the amount of time a person logs in.

awade

Registered User.
Local time
Tomorrow, 04:46
Joined
Apr 21, 2013
Messages
101
Good Evening All,

I have made a basic form and use it a log on screen. This requires the user to in put a user name and a password before gaining access to the main database.

The background to the form is a table where the users details are entered including the i enter the user name and password.


Is there any way to add a counter that is only visible in the table, so I can report on the different users.

Cheers
 
You could store the current date and time using the Now() function in a field on your table after the user logs in, for example, Me!TimeEntered = Now().

In the form or report you are using to determine how long the user has been logged on, use the datediff function to calculate how much time has passed.

=DateDiff("h",[TimeEntered],Now()) & ":" & DateDiff("m",[TimeEntered],Now())

would result in 1:15 for 1 hour 15 minutes, you can format any way you prefer.
 
Thanks for the response Billmeye. I have entered the Me!TimeEntered=now() in a field on the Table associated with the log in form and the =Datediff in a text box on the main form used for tracking usage and I get a #Name? error on the form.

Please help
 
I am not sure you are using the right terminology here.. The code given by billmeye, literally counts for the hour the user logged in for since he/she has logged in.. Is that what you want?

If you could explain in simple words, by maybe giving an example it would be able to strike the question with the right answer..
 
Thanks PR2.
I have a form that is uses as a log in page for the database.
There is a table attached to that form in which user names and passwords are added to allow people to log on to the database.
What I am after is a way to log how many times a users has logged onto the database. So each time a user logs on to the system it is counted and displayed on a form.
What I would also like to do is make the password expire every 12months, forcing the user reapply for access to the database.

Cheers
 
Okay lets make this clear, when you say make the user password expire every 12 months you mean from their initial login 12 months or 12 instances? If it is 12 months, then I thought I already gave you a suggestion to do this in your OTHER THREAD..
awade, I would create a new field in the table something like lastUpdated, which will have the first login date.. Which you can use to see if it has been a year.. You do not need a counter..
 
Thanks Paul.
The 12 months will expire from their initial first log in, and your sample database is exactly what I was looking for in that aspect.
Is there a way to add a counter to this so I can see how many times a user has logged onto the database? I need this for my company so as to ascertain which user / organisation is utilising the database.

Cheers
 
Why not create a logger table that will just keep a constant track of who logged in when? This will also be useful to see how frequently the user is logging into his/her account? Attached sample..
 

Attachments

Perfect Paul thank you very much. I will have a bit of a play around now with naming convention, and see if I can have it automatically tally the log on numbers to each person.

Appreciate you assistance in getting this sorted out.

Cheers

Andrew
 
Good Evening pr2,

I am now embedding this logon page into my database and I need it to open a form "eDNA Legal Notice" instead of displaying the msgbox "login success do whatever you want from here"
Could you please provide me some guidance on getting this working as I have tried renaming the command line to open that form with no success.

Cheers
 
Good Evening Paul,

Thanks for your quick response.
The original code I had was replacing the reference to the msgbox. Call Form ("eDNA Legal Notice.", vbinformation).

With no success I tried DoCmd.OpenForm ["eDNA Legal Notice"]

I feel rather stupid now, as I was getting the code for you I have realised my error. The code I had was DoCmd.OpenForn ["eDNA Legal Notice"]

After removing the brackets and spelling Form correctly it now works as intended.

Thanks for getting me to look at this code again.

Cheers
 
You are so close to closing this loop that I thought I might mention the method I use.

When my users log in, I record their internal user ID number which I get from a table lookup based on their domain name (as returned by the Environment("Username") function), the time they came in, and a check-mark in the username table tUSR. But I run a switchboard type of form that also allows me to know when they are leaving - via the form's OnClose event. So during the close-down, I store the time they left and reset a Boolean that records whether I think they are in or out at the moment. If it happens that the flag gets desynchronized, I'll know it because they'll log in and my table with think they are already logged in - so I have the login code record the glitch.

The only problem I have with this is when the network gets moderately flaky and disconnects their session. I won't tell you just how often that happens, but I'll say it is often enough that I recognize it when it happens. On the other hand, it gives me ammo for telling my network gurus just how stinky their stupid network has been today.
 

Users who are viewing this thread

Back
Top Bottom