Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If statements, how?

Status
Not open for further replies.

GWINTO

IS-IT--Management
Nov 26, 2001
188
GB
I want a field in a report to show a different value dependant on the date and field contents.

Pseudo
If date()>[finish date] and [field contents]is null then "Completed" else [field contents]

Probably simple if you know how, and I'm sure I've done this before but can I remember the bl**dy answer!!
 
You're right Gwinto - it is easy when you know how - but this is one of those things with a few hidden trip wires that can greatly benefit from the sort of help that this board can provide.

If date()>[finish date] and [field contents]is null then "Completed" else [field contents]


First off you need to have the text box control with DIFFERENT name to the table.FieldName what you are displaying.

So rename the textbox control to txtFieldContents

( By the way - see the FAQ
about avoiding bl**dy space characters in object names. )

Then in the txtFieldContents.ControlSource you put
=Iif(Date > #[finish date]# AND IsNull([field contents]),"Completed",[field contents])


QED.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top