Dr_Sherlock
New member
- Local time
- Today, 05:00
- Joined
- Apr 16, 2019
- Messages
- 2
Code:
Option Compare Database
Option Explicit
Const sSELECT = "SELECT tblUserLog.UserID, tblUserLog.LogIn, tblUserLog.LogOut " & "FROM tblUserLog "
Const sWHERE = "WHERE (((tblUserLog.LogOut) Is Null)) "
Const sORDER = "ORDER BY tblUserLog.LogIn DESC;"
Dim sSQL As String
[COLOR="Red"]Private Sub cmdAll_Click()
sSQL = sSELECT & sORDER
With Me.lstUsers
.RowSource = sSQL
.Requery
End With
Me.lblUsers.Caption = "Full Log"
End Sub
[/COLOR]
Private Sub cmdClose_Click()
DoCmd.Close acForm, Me.Name
End Sub
Private Sub cmdCurrent_Click()
sSQL = sSELECT & sWHERE & sORDER
With Me.lstUsers
.RowSource = sSQL
.Requery
End With
Me.lblUsers.Caption = "Currently Logged In"
End Sub
#the above gives me "Invalid use of Me keyword" after I debug the code in the highlighted part. How can I get this fixed?
Last edited by a moderator: