Expression for Expiration

  • Thread starter Thread starter Alex D.
  • Start date Start date
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?
 
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
 
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
 
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





.
 
Back
Top