IF function

giraffebaby

New member
Local time
Today, 00:54
Joined
Mar 15, 2006
Messages
5
Is it possible to put an IF function onto an access form.

What I am actually trying to achieve is the following:-

I have an "expiry date" in one field on the form and next door to this on the form if this date is actually expired I want to return the value EXPIRED and if it is in date return the value VALID.

I have tried putting in IF((Expiry Date) <NOW(),"Expired",Valid") - but it only returns the message NAME?

What am i doing wrong?
 
Start by naming the TextBox that displays the "expiry date" something other than the name of the field to which it is bound. Try "txtExpiryDate". Then modify the ControlSource of the TextBox next door to:
=IIF( [txtExpiryDate] < Date() ,"Valid" , "Expired" )
 
Your biggest problem is that you were using IF instead of IIf
 

Users who are viewing this thread

Back
Top Bottom