By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,327 Members | 1,805 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,327 IT Pros & Developers. It's quick & easy.

No Value Given for one or more required Parrameters

P: 171
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.

Expand|Select|Wrap|Line Numbers
  1. strSQLStartNullEndNull = "SELECT Date, UserID, TimeEnd, TimeIn " & _
  2. "FROM tblTimeCard " & _
  3. "WHERE Date= " & Date & " AND UserID = " & CurrentUser & _
  4. " AND TimeEnd Is Not Null AND TimeIn Is Not Null"
  5. Set cnn = CurrentProject.Connection
  6. rst.Open strSQLStartNullEndNull, cnn, adOpenDynamic, adLockOptimistic
I pasted this same query in access query builder and it works perfectly this is what the code was:
Expand|Select|Wrap|Line Numbers
  1. SELECT Date, UserID, TimeEnd, TimeIn FROM tblTimeCard WHERE Date=  Date () AND UserID = CurrentUser () AND TimeEnd Is Not Null AND TimeIn Is Not Null
Sep 26 '08 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 2,653
Hello, iheartvba.

The following stuff may be helpful for you.
Literal DateTimes and Their Delimiters (#).
Reserved Words in Access, Especially Date and Time


P.S. SQL expression you've pasted into query builder is well not the same as that the code generates.
Sep 26 '08 #2

P: 171
Thanks A Lot, that fixed it, as soon as I saw the solution I remembered I faced with this problem maybe last year. So I am sorry if I have double posted.

P.S. Keep it up you guys are a salvation to newbie programmers.
Sep 29 '08 #3

Expert 2.5K+
P: 2,653
You are welcome.

Best regards,
Sep 29 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.