Carriage Returns Ignored in Report Text Box!

Cavman

Registered User.
Local time
Today, 09:40
Joined
Oct 25, 2012
Messages
66
Hi All,

The following code is in a text box on a report in a database that creates work contracts. The IIF statements and Dlookups pull the parts of the text together perfectly, but can anyone suggest why the new line and carriage returns are completely ignored in the last section? Been working on this all day and we can't find a way of inserting 2 new lines!

Code:
[COLOR=#000000][FONT=Segoe UI]=DLookUp("Description","QFRCL07") & (IIf(DLookUp("Description2","QFRCL07") Is Not Null,DLookUp("BasicSalary","Tmain","ContractID=ContractID") & " " & DLookUp("Description2","QFRCL07"),"")) & (IIf(DLookUp("Description3","QFRCL07") Is Not Null,DLookUp("Job","Tmain","ContractID=ContractID") & " " & DLookUp("Description3","QFRCL07"),"")) & (IIf([Forms]![FFRRCheck]![Text305] Is Not Null,(Chr(13) & Chr(10) & Chr(13) & Chr(10) & [Forms]![FFRRCheck]![Text305]),""))
[/FONT][/COLOR]

Thanks,

Simon :banghead:
 
Last edited:
Try changing:
(IIf([Forms]![FFRRCheck]![Text305] Is Not Null
to
Code:
IIf (Not IsNull([Forms]![FFRRCheck]![Text305])

Otherwise, are your sure it ever results in the carriage returns? It's a complex statement. Have you tried breaking it out to multiple controls and putting it back together in another control just to make sure it is all firing like you think?
 
Thanks for your reply! The logic in the statement is definitely working because the text from the [Text305] box following the carriage returns is being concatenated properly, but it's just displaying 2 spaces in front of the text where the new lines should be! We've also tried putting the new lines directly into the text in the table also using [ctrl]+[Enter], but even that doesn't work when you run the report. Something seems to be cancelling them out, but I can't think of anything.
 
1. Have you set the "Text Format" property for the text control to "Rich Text"?
2. To insert a new line the you need to use the "HTML" code = <BR>
Like:
Code:
=[YourControlSourceName] & '<Br>' & '<Br>' & [AnotherControlSourceName]
 
Brilliant, thanks JHB! Finally something worked. I would never have thought of using the html!
 
You're welcome. Now you know it. :)
 

Users who are viewing this thread

Back
Top Bottom