how to insert an if logic in the builder Access 2007

KWHAT

Registered User.
Local time
Today, 00:49
Joined
Dec 7, 2011
Messages
19

=[Forms]![Route Form]![ CreatorDD]+"_"+[Forms]![Route Form]![OriginDD]+"_"+[DAYS OF]+"_"+[SERVICE TYPE]+"_"+[EXTRA DAYS]+"EX""

From the code above every time I have nothing in the field [EXTRA TRANSIT DAYS] this string is not printed out, I want to place like a if statement in here as so
If IsEmpty([EXTRA TRANSIT DAYS]) then
else
+"_"+[EXTRA TRANSIT DAYS] + "Ex"
End If
Can anyone help me in this.
 
(IIf(Len([Extra Transit Days] >0, +"_"+[Extra Transit Days],Null))

You can search help on the IIf function in Access.
 
I would suggest using the ampersand (&) for concatenation in Access instead of the plus (+) sign for anything you want to appear should you have nulls in your fields. Using the + sign will propagate nulls and therefore not show it if a null exists.

You also need to include spaces between the items:
 

Users who are viewing this thread

Back
Top Bottom