Ken,
If I understand what you asked, then the field that holds that data that
is being displayed on the main form is from the subform. The subform
reflects data from a query that sorts data from a guest stay table. The
field is called "staystart". It holds the date that a guest arrives at
our B&B. It is stored in the guest stay table. The data from that field
is enterd on the subform and displayed through the IIf statement
=IIf(IsNull([subfrmStays].Form!StayStart),"None",[subfrmStays].Form!StayStart)
on the main form. The "staystart" field is a date/time field. Does this
help?
Scott
Ken Snell said:
If what I posted isn't working, it is likely that is because I guessed
at which "control" contains a "future" date and used that. So most
likely my expression isn't using the correct data.
You'll need to tell us more specifically what the controls hold, and
what you want to do (in words) within the expression.
--
Ken Snell
<MS ACCESS MVP>
Dear Ken,
Thanks for the quick reply and your help. I tried your language and
the OR does not seem to work. The "None" and the dates still work but
it does not filter out the future date correctly. For the record that
has a future date it displays "None". Any thoughts? By the way, does
it matter that the date is on a subform from a different query? I am
only displaying this on the main form to save constantly clicking back
and forth to see when the guest stayed last for tax purposes and to
make sure I have data entered on the subform. If I enter data on the
form I will always enter a stay start date.
Best regards,
Scott
=IIf(IsNull([subfrmStays].Form!StayStart) Or
[subfrmStays].Form!StayStart >
Date(),"None",[subfrmStays].Form!StayStart)
--
Ken Snell
<MS ACCESS MVP>
Greetings,
I have the following IIf statement that works fine. I would like to
add an OR clause to make it not display the date if it is later than
today.
=IIf(IsNull([subfrmStays].Form!StayStart),"None",[subfrmStays].Form!StayStart)
The label for the field says "Last Stay Date, but the data in the
table sometimes contains future dates as well as past dates.
Best regards,
Scott B