IIf expression

  • Thread starter Thread starter Marina
  • Start date Start date
M

Marina

I'm having problems with an IIf expression. I have two
fields, one with an expiration date and the other I want
the word "Expired" or "Active" to automatically populate
based on the expriation date field.

This is what I have tried:

IIf([ExpDate]>=.date, "Expired", "Active") and
IIf([ExpDate]>=()date, "Expired", "Active")

I'm also not sure where to insert the expression.
 
Try: This should be in a query where ExpDate is available to the calculation
Status:IIf([ExpDate]>=Date(), "Expired", "Active") Note: Place the calc in
an empty field on the Field line.

Then this information can be used on a form or you can use a textbox control
directly on a form and just set the ControlSource to only the IIf part of
the calculation leaving off Status: and adding an = in front. such as:
=IIf([ExpDate]>=Date(), "Expired", "Active")
 
Oops reverse the order of "Expired" and "Active" or change the value to be
<= and not >=
 
Put this expression in the controlsource property of the textbox where you want
Expired or Active:

= IIf([ExpDate]< Date(), "Expired", "Active")
 
Back
Top