Solved

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

Posted on 2011-03-20
4
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

623 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