Empty field causing line break

  • Hello All Happy Friday!

    I have a report that is using a field Address2 which is often empty (empty string ''). When the report is displayed the empty field causes a line break or empty line between Address1 and City. Does anyone know if there is a IF statement that can be used to remove this empty line when the value is missing?

  • It sounds as though you are printing all of the fields seperately on the report, I would probably create a single address field that takes care of the blanks, for example:

    Expression value for the address column would be something like:

    IIF(AddressLine1.Value<>'',AddressLine1.Value + VbCrLf) +

    IIF(AddressLine2.Value<>'',AddressLine2.Value + VbCrLf) +

    IIF(City.Value<>'',City.Value+VbCrLf) +

    IIF(Country.Value<>'',Country.Value)

    The other way you can do it is to use your current option of printing all fields individually, but on each row you would place an expression against the Hidden property (under the visibility section) such as:

    IIF( AddressLine2.Value='' , TRUE , FALSE ) which, roughly translated, means hide this section if the address line 2 is blank.

    Good luck,

    Nigel.

    Nigel West
    UK

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply