Hi Everyone,
I have been using access query builder for a while now and want to perfect my SQL coding. I am trying to run this query in VBA but it gives the following error: Run-time error '-21427217904 (80040e10)': No Value Given for one or more required Parrameters.
I pasted this same query in access query builder and it works perfectly this is what the code was:
I have been using access query builder for a while now and want to perfect my SQL coding. I am trying to run this query in VBA but it gives the following error: Run-time error '-21427217904 (80040e10)': No Value Given for one or more required Parrameters.
Code:
strSQLStartNullEndNull = "SELECT Date, UserID, TimeEnd, TimeIn " & _ "FROM tblTimeCard " & _ "WHERE Date= " & Date & " AND UserID = " & CurrentUser & _ " AND TimeEnd Is Not Null AND TimeIn Is Not Null" Set cnn = CurrentProject.Connection rst.Open strSQLStartNullEndNull, cnn, adOpenDynamic, adLockOptimistic
Code:
SELECT Date, UserID, TimeEnd, TimeIn FROM tblTimeCard WHERE Date= Date () AND UserID = CurrentUser () AND TimeEnd Is Not Null AND TimeIn Is Not Null
Comment