Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

users logging into the database 1

Status
Not open for further replies.

MichelleButler

IS-IT--Management
Apr 5, 2002
73
GB
I have created a form that allows users to log in, the code checks the password stored into the table and then allows then access to the database if correct. I would like to be able to get the information stored into a different table such as auditing everytime the user logs on the username, and date login is stored. Please help!!!! I would like to be able to run stats against the table to see how often the the user log on to the database.

Please help!!! the other solutions is not what I am after. I do not want to user system.mdw.
 
You need a table to record the activity.

tblLogins
ID autonumber
LoginTime Datetime
LoginName Text

I'm assuming the username is in a textbox called txtUName.

Then in your routine that checks the password, you can add to the OK leg:

Dim strSQL

strSQL = "Insert into tblLogins (LoginTime,LoginName) Values (Now(),'" & me.txtUname & "')"

currentdb.execute strsql
 
Thank you for the advise, this sounds like what I am after. I will give this a go!!!!

Many thanks

Michelle
 
Thank you for the brilliant information, it works a treat. I would also like to be able put into the same coding if possible, useraccess to menus. Let say if one person from Finance logins into the database, the username is checked for the password and then in the same table the useraccess permission is "finance", or "admin" and this directs the user to the correct log in form. ie Management would be directed to the Managment form. The table would be set up like this Username, password, Accesslevels. Could you provide me with any coding on this.

Many thanks

Michelle
 
Take a look at the DoCmd.OpenForm method.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top