Expression for Expiration

A

Alex D.

I'm trying to get a textbox on my form to
display "Contract Will Expire Soon", but I don't know
which expression to use. I want this displayed when The
Contract has less than 30 Days left. I have a contract
end date control, but what ecpression can I use?
 
N

Nikos Yannacopoulos

Alex,

Date/Time fields in Access actually hold numerical values, the integer part
being the date and the decimal part being the time (0 is 31/12/1899, today
is 38163). That said, assuming the control is called Exp_Date, then your
check would be:
If Me.Exp_Date - Date() < 30 Then
....

HTH,
Nikos
 
A

Alex D.

I'm looking more for an expression to use in the text box
and not VBA code. I tried using
<<<=IIf(([Duration To]-30)<[tdate]<[Duration
To],"Contract is going to expire soon","")>>> And It
didn't work, I have other feilds that work fine when
using < or > comparing dates. (Such as if the contract
expiry date is the less than or equal to the start date
then there is an error <<[Forms]![ICAForm2]![Duration To]
<=[Duration From]>> I don't know why my expression for
the contrract end date isnt working
 
G

German Saer

Then, the expression of the calculated field should be something like this:

=IIf([Exp_Date]<Date()+30,"Contract is going to expire soon","")

German saer
(e-mail address removed)
Orlando, FL

Alex D. said:
I'm looking more for an expression to use in the text box
and not VBA code. I tried using
<<<=IIf(([Duration To]-30)<[tdate]<[Duration
To],"Contract is going to expire soon","")>>> And It
didn't work, I have other feilds that work fine when
using < or > comparing dates. (Such as if the contract
expiry date is the less than or equal to the start date
then there is an error <<[Forms]![ICAForm2]![Duration To]
<=[Duration From]>> I don't know why my expression for
the contrract end date isnt working

-----Original Message-----
Alex,

Date/Time fields in Access actually hold numerical values, the integer part
being the date and the decimal part being the time (0 is 31/12/1899, today
is 38163). That said, assuming the control is called Exp_Date, then your
check would be:
If Me.Exp_Date - Date() < 30 Then
....

HTH,
Nikos





.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top