HI All,
the code below works fine with access 2010 version (Local machine) but we have a network drive (Company share drive) which is on Access 2003 and the same code doesnt work on that version
Can you pls help me with the Logon/Logoff tracking code for 2003 version.
Globals Module :
Option Compare Database
Option Explicit
Public Sub Logging(Activity As String)
CurrentDb.Execute "INSERT INTO tbl9ActivityLog (UserName, Activity) Values('" & TempVars("UserName").Value & "', '" & Activity & "')"
End Sub
LOGIN FORM CODE :
Option Compare Database
Option Explicit
Private Sub btnLogin_Click()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("tbl1Employees", dbOpenSnapshot, dbReadOnly)
rs.FindFirst "UserName='" & Me.txtUserName & "'"
If rs.NoMatch Then
Me.lblWrongUser.Visible = True
Me.txtUserName.SetFocus
Exit Sub
End If
Me.lblWrongUser.Visible = False
TempVars("UserName").Value = Me.txtUserName.Value
If rs!Password <> Nz(Me.txtPassword, "") Then
Me.lblWrongPass.Visible = True
Me.txtPassword.SetFocus
Exit Sub
End If
Me.lblWrongPass.Visible = False
Me.Visible = False
Globals.Logging "Logon"
DoCmd.OpenForm "Menu_Selection"
' DoCmd.Close acForm, Me.Name
End Sub
-----------------
Private Sub Form_Unload(Cancel As Integer)
Globals.Logging "Log-off"
End Sub
Thanks
Guddu