how to make lastlogin date & time (2 Viewers)

SalmanZeiad

Member
Local time
Today, 05:22
Joined
Oct 30, 2017
Messages
114
i want to make form display in text box last login or entered to form
 
Describe more exactly where you are stuck in accomplishing that task.
 
You didn’t add much detail however you can add a text box with a Control Source like:
=DMax(“DateFieldName”, “TableName”)
 
Well, first you need to store this data.
Then when you login, you look for that data.
I would use a record for each login, so you can DMax() on the DateTime, then store a new record as you log out, or even as soon as you log in.
 
Further to what has been suggested, you need a table called something like "tblLogin". It will need fields like "Login" and "LoginDateTime". In an AuthoExec macro, call a function that captures the UserID of the person starting the application and the date and time of that login. Store that in your Login table. From that data, retrieving the most recent login for each user is straightforward using DMax().
 
Further to what has been suggested, you need a table called something like "tblLogin". It will need fields like "Login" and "LoginDateTime". In an AuthoExec macro, call a function that captures the UserID of the person starting the application and the date and time of that login. Store that in your Login table. From that data, retrieving the most recent login for each user is straightforward using DMax().
I would retrieve before storing, else you will always get the current login?
 
i want to add for example ,"last login :1-1-2026" to my login form

You have gotten several responses. I will explain a fine point to help you go forward in this issue.

Access is a bare-bones rapid application development system that gives you the tools to do things you want done. With VBA you can be very flexible. You can have all sorts of login and update and visitation statistics in history tables. BUT you have to build them yourselves. The basic rule is that if you want to be able to track something - like a login - you have to write code to STORE that login and define a place to keep that information for future use. For tracking logins, that usually means building a tblLoginHistory that tracks date and user ID for each login. It is possible to keep other things in that proposed table, but for VBA and Access, the rule is "You want it? You build it."
 
I was beginning to think it was post bait, as o/p has not bothered to come back.
However, I myself have managed to ask the same question twice, as my memory is so bad. :-(
 
You have gotten several responses. I will explain a fine point to help you go forward in this issue.

Access is a bare-bones rapid application development system that gives you the tools to do things you want done. With VBA you can be very flexible. You can have all sorts of login and update and visitation statistics in history tables. BUT you have to build them yourselves. The basic rule is that if you want to be able to track something - like a login - you have to write code to STORE that login and define a place to keep that information for future use. For tracking logins, that usually means building a tblLoginHistory that tracks date and user ID for each login. It is possible to keep other things in that proposed table, but for VBA and Access, the rule is "You want it? You build it."
Ok, i understood
 

Users who are viewing this thread

Back
Top Bottom