I have got this code to interogate a time card table, it selects all records where a the currently signed in user has logged his time in on todays date, and not logged his time out.
The issue is that even when I the User has logged in and not logged out on the day, the result of the recordset is still rst.EOF = True and rst.BOF = True, which indicates the recordset is empty. when I run this query in the query builder it comes up with a record (I.E. rst.EOF = False and rst.BOF = False).
Expand|Select|Wrap|Line Numbers
- Dim strSQLEndNull as String
- strSQLEndNull = "SELECT Date, UserID, TimeEnd " & _
- "FROM tblTimeCard " & _
- "WHERE Date= #" & Date & "# AND UserID = '" & CurrentUser & "' " & _
- "AND TimeEnd Is Null AND TimeIn Is Not Null"
- Set cnn = CurrentProject.Connection
- rst.Open strSQLEndNull, cnn, adOpenDynamic, adLockOptimistic