Solved

How do I add a line break in a report text box?

Posted on 2011-03-20
4
317 Views
Last Modified: 2012-05-11
The ControlSource for the text box in my report is: =[strHorseBarnName] & IIf(Not IsNull([strHorseRegisteredName])," (" & [strHorseRegisteredName] & ")","")

How do I get the registered name to print in a line below the barn name (if it is NOT null)?

I tried  vbCrLf but that did not work.
0
Comment
Question by:bobbat
  • 2
  • 2
4 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 350 total points
ID: 35177490
try

=[strHorseBarnName] & IIf(Not IsNull([strHorseRegisteredName]),Chr(13) & Chr(10) & "(" & [strHorseRegisteredName] & ")","")
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 350 total points
ID: 35177748
or maybe this

=[strHorseBarnName] & IIf([strHorseRegisteredName] & ""<>"",Chr(13) & Chr(10) & "(" & [strHorseRegisteredName] & ")","")
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 150 total points
ID: 35179191
If these are text fields then you really need to be checking for empty strings ("")

Nulls are, (For lack of a simpler definition), irrelevant in string (text) fields in MS Access.

So, these worked fine for me:

=[strHorseBarnName] & IIf([strHorseRegisteredName]="","",Chr(13) & Chr(10) & [strHorseRegisteredName])

=[strHorseBarnName] & IIf(Len([strHorseRegisteredName])=0,"",Chr(13) & Chr(10) & [strHorseRegisteredName])

See here for more info:
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/A_1910-Understanding-Null-Empty-Blank-N-A-ZLS-Nothing-Missing.html

;-)

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 35179207
Or like this with the parenthesis:

=[strHorseBarnName] & IIf([strHorseRegisteredName]="","",Chr(13) & Chr(10) & "(" & [strHorseRegisteredName] & ")")

Or

=[strHorseBarnName] & IIf(Len([strHorseRegisteredName])=0,"",Chr(13) & Chr(10) & "(" & [strHorseRegisteredName] & ")")
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question