View Full Version : Positioning Text in Text box on report


Transentient
03-19-2008, 05:26 AM
I am using the following code, to extract data and display on a report, which then can be printed as a mailing label. Works great.

=IIf(IsNull([CompanyName]),"",[CompanyName] & "" & Chr(13) & Chr(10)) & IIf(IsNull([Address1]),"",[Address1] & "" & Chr(13) & Chr(10)) & IIf(IsNull([Address2]),"",[Address2] & "" & Chr(13) & Chr(10)) & IIf(IsNull([Address3]),"",[Address3] & "" & Chr(13) & Chr(10)) & IIf(IsNull([Town]),"",[Town] & "" & Chr(13) & Chr(10)) & IIf(IsNull([County]),"",[County] & "" & Chr(13) & Chr(10)) & IIf(IsNull([Country]),"",[Country] & "" & Chr(13) & Chr(10)) & IIf(IsNull([PostCode]),"",[PostCode] & "" & Chr(13) & Chr(10)) & IIf(IsNull([Greeting]),"",[Greeting] & " " & IIf(IsNull([Title]),"",[Title] & " " & IIf(IsNull([Firstname]),"",[Firstname] & " " & IIf(IsNull([Surname]),"",[Surname]))))

Now for positional reasons I want to force a new line prior to the top line of the address, moving the txt box itself will not work as this will screw up the pitching of the labels The text in the box has to move down a line.

Can anyone sugest anything, tried using VbCrlF to force a carriage return prior to the If statement, but it didn't work

Any ideas greatfully recieved

Many thanx

gemma-the-husky
03-19-2008, 05:53 AM
just put chr(13) & chr(10) before the company name - vbcrlf is the same thing, but sql doesnt understand it, so sometimes you have to be explicit

Transentient
03-19-2008, 09:11 AM
Hi, Thanks for that, so simple, worked a treat