DLookUp("[Weekend]","[Week
Main Topics
Browse All TopicsI have a table with the next 10 years of weekending dates.
In my form I want the weekending date (for that week) to appear, in a date field on the form, when text is completed in the report memo field.
I have put the follwing code in the AfterUpdate event of the memo field, but get and error message.
[WeDate], DLookUp("[Weekend]","[Week
Please could you tell me where I am going wrong? Or is their a simpler way?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
SparkyP,
<<Please could you tell me where I am going wrong?>>
When you pass in a argument as a string (between quotes) and your using a function, form reference, etc, you want the value of that, not the reference itself.
With this statement:
"[Weekend]=Betwe
What your saying is that the field [Weekend] must equal the characters 'Between Date() and Date()+7'
which of course it never will because it is a date field. And actually, that is even not quite right as you should not have had the equals sign in there. A correct statement for checking for actual characters would look like this:
"[Weekend] = 'Between Date() and Date()+7'"
It's kind of hard to see the single quotes, so some would write it as this:
"[Weekend]=" & chr$(34) & "Between Date() and Date()+7" & chr$(34)
End result of what Access would see is:
[Weekend] = "Between Date() and Date()+7"
Chr$(34) is a quote character and all this has to do with passing values inside of a string argument.
But anyway, back to your statement. As Patrick has shown, the correct statement is this:
"[Weekend] Between #" & Date() & "# and #" & (Date()+7) & "#"
What Access will now see as a result is this:
[Weekend] Between #11/05/2009# and #11/12/2009#
As you can see, we now have the value of Date() and Date()+7. The #'s are delimiters that tell Access that this is a date value.
HTH,
JimD.
Business Accounts
Answer for Membership
by: tsgiannisPosted on 2009-11-05 at 05:51:27ID: 25749384
DLookUp("[Weekend]","[Week endDate]", "[Weekend] Between Date() and Date()+7")