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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid controlsource based on IIF 2

Status
Not open for further replies.

ahaws

Programmer
Nov 28, 2001
355
US
Hi -
Have a column4 - control source is a date field, however, if the field is empty I want the grid to say "NO" and if not empty - then "YES".

If I control source to the field, then the data type error happens - because it is a data field.

How can I achieve this?
thanks in advance
 
You can use an expression as the ControlSource for a column if you enclose it in parentheses. (You may have to put an = in front of the parentheses too.) Just be aware that this will render the column read-only.


-BP (Barbara Peisch)
 
ahaws

To add to BPeisch's suggestion, you could also add two labels (one that say "NO", one that says "YES", and alternate bewteen the two with the dynamiccurrentcontrol, depening on your condition, and this would also have the same effect as BPeisch describes, it would render the field read-only.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thanks Barbara.
I just realized that I had a post earlier that asked the same thing, kind of, Ramani had answered before -but it seemed to work.
.column4.ControlSource = 'Iif(Empty(BKPROPID.claimfiled),"NO","YES")'

just had to put quotes around entire thing.

Thanks again-
angie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top