display field based on condition (1 Viewer)

Khushalay

Registered User.
Local time
Today, 09:28
Joined
Apr 16, 2016
Messages
180
Hi friends

I have three delivery dates in my form. Customer DD(Given by customer), Our DD(agreed by the us, the company) and Revised DD (in case the DD has been revised).

But have one field in the report to show the DD. Now the logic behind is that the field should display the Revised DD but if Revised DD is Null then it should display the Company's DD and if that is also Null, then it should take the value of Customer DD.

How to do that? Through vba? and how? Plz guide me.

Thanks
 

moke123

AWF VIP
Local time
Today, 12:28
Joined
Jan 11, 2013
Messages
4,047
you could try nested iif's or Nz() or switch().
I like switch as its easiest to read.
something like...
Code:
Expr1: Switch(Not IsNull([RevDD]),[RevDD],Not IsNull([CompDD]),[CompDD],Not IsNull([CustDD]),[CustDD])

substitute your field names for mine.
 

Khushalay

Registered User.
Local time
Today, 09:28
Joined
Apr 16, 2016
Messages
180
Sorry for being naive but do I have to write this in Query or Coding? If in coding, which event?
 

Khushalay

Registered User.
Local time
Today, 09:28
Joined
Apr 16, 2016
Messages
180
Thanks alot

I put it in Query and it worked perfectly.
Thanks once again
 

moke123

AWF VIP
Local time
Today, 12:28
Joined
Jan 11, 2013
Messages
4,047
yes, that was for a query.
your welcome and good luck with your project.
 

Users who are viewing this thread

Top Bottom