Tracking a login (1 Viewer)

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
I could use some advice on how I can track my logins. What I am trying to do is once the Agent clicks login and their Id and password are validated, I want it to store the agent ID and the date time of login into a table labeled stored logins. I have been trying to set local variable but I continue to get a error saying that its not an automatic function. I am not real good with coding I am a intermediate user. any advice or examples would be really helpful.
Thanks
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
Im sorry but that didnt help me much. from what I understood in your vba code, most of what I saw and understood was for resetting passwords. what I am trying to do is set a local variable that stores date/time of the agent log in. Access keeps telling me that setlocalvar is not an automatic function and I would try and write it out in VBA but i am not that knowledgeable with writing code. The reason I need to store date/time and agent id is track everyone's volunteer time per week on the help desk. if you could show me what part of your code is for storing the date/time value that would be really helpful.
 

DCrake

Remembered
Local time
Today, 17:40
Joined
Jun 8, 2005
Messages
8,632
If you follow the CreateSession() function this willshow you how it adds a record to the session table.
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
Hey I followed your example and pointed to all my of tables and fields(they are not exactly like yours but I understand where you are pointing to) the issue i face is that its not storing the time value.now() or the agentID.

Im not really sure what I can ask you to help me fix the issue. All I understand is that the record of the agentloginID and the date/time is not being saved in the storedlogins tbl. I am not extremely knowledgeable about this. I have mainly self taught myself.
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
Dcrake,
I am curious on how I can store the logout time onclick_Logout. I have managed to create the login but when I try to log out it tells me I have a data mismatch. This is where the debug tells me that I have that mismatch.
Code:
[COLOR=Red]Set Rs = CurrentDb.OpenRecordset("SELECT * FROM [StoredLogins] WHERE SessionID ='" & LngLoginId & "'")[/COLOR]
The session ID is an autonumber which is what you have in your sample. However my agent login ID is not long but a string. I have declared in my public statement that lngloginid as string. So I am curious do I need to change lngloginid to something else and then declare it as long?

What I am doing for logout is slightly different from what you did. I created a logout form and from there I want the agent to insert their ID in an unbound cbo and reenter their password(so some random person cannot log them out, the agents will be working on shared computers).

If Im right you have the frmSessions opening and then when they go to log out for the day they highlight their name and click logout, which takes that sessionID which Im assuming remains open in the frmsessions until they click logout and it closes that open session
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
I am so sorry to hear. Thank you for informing me.
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
I have created a new form that is just logout, the other one is just login. Sorry it took so long to get back to you I was watching the MN Twins throw a no hitter.
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
Bob if you send me your email address I can send you my updated DB. the zip file is to big to repost Ive been entering in a lot of data to test it out. I made some really nice updates today to it. I want you to know how thankful I am to you, for taking your personal time to give assistance to a rookie. If you ever happen to come up to the Minneapolis area, Id like to buy ya a dinner for all your help. Thanks
 

SeanATech

Rookie but trying
Local time
Today, 11:40
Joined
Apr 13, 2011
Messages
35
Bob,
Thank you so much. It works perfect. I cant believe you did that so quick. I have been working on that for over 2wks now and you managed to do it in only a couple of hours. I cant thank you enough, my stress levels are going to drop significantly now. Again thank you for all your patients and help.
 

GohDiamond

"Access- Imagineer that!"
Local time
Today, 12:40
Joined
Nov 1, 2006
Messages
550
Hi Bob,
I was hoping to get a look at your example file but I've got 2003. Do you have this one in a db format I can open?
Thanks!
Goh
 

theKruser

Registered User.
Local time
Today, 12:40
Joined
Aug 6, 2008
Messages
122
Bob-

I know it has been a while since you posted the db above, but I am hoping you are still subscribed to this thread. I downloaded it, but when I try to open it I get an error, "Unrecognized file format." I am running Access 2007. Any ideas?

Also, what is the benefit of storing/using session ID vice just username?

Thanks for your time and help.
 

Users who are viewing this thread

Top Bottom