The set up:
I'm working in a form that's not bound to a table or query. This issue is occurring in several parts of my form but I'll give one part as an example. Say we've got two unbound text boxes called [Fruit1] and [Fruit2] (say the user enters in Apples in one field and Bananas in the other), then we've got a third text box that outputs the following, "I like Apples and Bananas"
The statement:
I'm using an IIF statement to vary the output so that if one of the [Fruit] fields is left blank the sentence that outputs will still make sense (instead of getting "I like Apples and"). The statement, which goes into a 3rd text box looks like this:
=IIF(IsNull([Fruit2]), "I like " & [Fruit1], "I like " & [Fruit1] & " and " & [Fruit2])
I should note that [Fruit1] is a field that will be filled out every time, but [Fruit2] is optional
The issue:
The statement works perfectly if I type something into both fields, and then delete [fruit2], but if I start with a clear form and pass over [fruit2] altogether I get: "I like [Fruit1] and ". I've tried using the NZ() function in place of IsNull() and in that case the initial output is correct, but the statement doesn't update if I fill out [Fruit2].
The Question:
Why is this happening to me! /falltotheearth
How can I get my statement to work properly in this context?!
Thanks in advance for all your help!