Basically, to create a log table for a specific mdb and tracking when users get into it, you want to create a table with a LoginID (text) and DateTimeLoggedIn (date/time) fields.
You can then put in code in the form which initially opens (not the Mainform which may open multiple times but an "initial" form such as a background form which opens once and initially - or just call the function to do the appending and then open your MainForm in the Tools->Startup). Your code will get the username/LoginID (see getuser() function here or in the code bank: http://www.dbforums.com/showpost.php...0&postcount=20) and will append the username/LoginID and the current time (i.e. Now()) to the table. Here's an example of code you could have in the onOpen event of the "background" or initial form which opens:
(note: uses ADO)
Dim rs as adodb.recordset
set rs = new adodb.recordset
dim strSQL as string
strSQL = "Select * from MyLoginTableName"
rs.open strSQL,currentproject.connection,adopendynamic,adl ockoptimistic
rs!LoginID = getuser() <- from the getuser function
rs!DateTimeLoggedIn = now()
set rs = nothing
Last edited by pkstormy; 11-21-07 at 16:12.
Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)