If it is ok to put them all into one textbox, you could do this:
=Fields!Address_name.Value
& chr(10) & Fields!Address1.Value
& IIf(Len(Fields!Address2.Value) > 0, chr(10) & Fields!Address2.Value, "")
& chr(10) & Fields!Address_city.Value & ", " & Fields!Address_State.Value & " " & Fields!Address_PostalCode.Value
If they have to have their own textbox and you just want to move it up if the Address2 is empty, then you could try something like this.
In the expression for the Address2 textbox:
=IIf(Len(Fields!Address2.Value) > 0, Fields!Address2.Value, Fields!Address_city.Value & ", " & Fields!Address_State.Value & " " & Fields!Address_PostalCode.Value)
Then, in the expression for the City/State/Postal Code:
=IIf(Len(Fields!Address2.Value) > 0, Fields!Address_city.Value & ", " & Fields!Address_State.Value & " " & Fields!Address_PostalCode.Value, "")
Hope this helps.
Jarret
|||Thanks mate, I'll give it a try.!
What does "Len" do?
|||Len gives you then length of the object you pass in. In this case, if the Address2 is NULL or an empty string, Len will return 0 and it will be skipped with the logic in the code.
Let me know if that fixes your issue.
Jarret
|||I see, thanks for the info. I will try this in about an hour or so, I'll post back and give you an update.
Thanks again Jarret,
Bill
No comments:
Post a Comment