While using Now will work in this situation, having Date not work can
indicate a problem with your database. Using Now can have unwanted side
effects, since it includes Time as well as Date.
First thing to check is whether you've named anything in your database Date:
a field in a table, a control on a form, a variable in your code, and so on.
If so, rename the object: Date is a reserved word, and you can run into all
sorts of problems using reserved words.
If you can't find anything named Date, you may have a Reference problem.
These can be caused by differences in either the location or file version of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.
On the machine(s) where it's not working, open any code module (or open the
Debug Window, using Ctrl-G, provided you haven't selected the "keep debug
window on top" option). Select Tools | References from the menu bar. Examine
all of the selected references.
If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.
If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)
For far more than you could ever want to know about this problem, check out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
--
Doug Steele, Microsoft Access MVP
Amal said:
Never mind Rick, I changed Date to Now and it works.
Thanks again.
Amal
-----Original Message-----
Thanks Rick. But when I go to run the report it asks for
Date. Do you know why?
Amal
-----Original Message-----
Hi,
I need to know when a contract is going to expire. I want
a report to show, "Get on the stick Helen, it's going to
expire!" when the date is two months (60 work days) away.
I used the following expression to let me know when a
license has expired:
=IIf([PI Lic Exp]<=Date(),"EXPIRED!") What do I change?
=IIf([PI Lic Exp]<=DateAdd("d",60, Date()),"Get on the stick Helen, it's going to
expire!")
.
.