nested iif statements (1 Viewer)

skied97

New member
Local time
Yesterday, 18:24
Joined
Jun 1, 2007
Messages
1
This should should be straightforward but i cannot get the expression to work.

I enter a number of days into a field called DAYS and want to use this number to look up a table of descriptions with the selected description populating a field called PAYMENT TERMS.

I have entered the following expression into the text field called PAYMENT TERMS

=iif([days]=0,"terms are payment on completion",iif([days]=7,"terms are 7 days from date on invoice",iif([days]=14,"terms are 14 days from invoice","invalid number of days")))

I keep getting [#name? in the PAYMENT TERMS FIELD.

What am I doing wrong?
 

pdx_man

Just trying to help
Local time
Yesterday, 18:24
Joined
Jan 23, 2001
Messages
1,347
1st problem ... posted in wrong forum ...

Other than that, I see nothing wrong. It works for me. Ensure that the name of the field is truly DAYS.
 

boblarson

Smeghead
Local time
Yesterday, 18:24
Joined
Jan 12, 2001
Messages
32,059
Make sure that days is also not the name of the text box, if so rename the text box to txtdays and when saving, due to autocorrect, it will likely rename your field in the IIf statement so rename it back to days.
 

Users who are viewing this thread

Top Bottom