Link to home
Start Free TrialLog in
Avatar of ljcor
ljcorFlag for United States of America

asked on

Access 2002 Report - Break a text line on a space

I have a report which has to display a number of long lines of text.  Inevitably this text is too long for a single line space.  So the text needs to be broken at a logical BLANK space and then continued on the next line.  An example of how Access handles it is shown below.  Access breaks the line in the middle of a word and does not print the rest of the word before continuing the text on the next line.

Is there a way to have Access break this text at a blank automatically - or do I have to write a VBA routine to format the text properly?
This long line of text should be broken at a blank space before continu
to the next line.  Breaking in the middle of a word is not acceptable.

Open in new window

Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

<<Is there a way to have Access break this text at a blank automatically - or do I have to write a VBA routine to format the text properly?>>

  None that I'm aware of.  You'd have to write a routine to reformat the text putting in a vbCRLF at the apporpriate spots based on the width of the control.

  Font type and size would need to be taken into account.

JimD.
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ljcor

ASKER

peter57r

I am using Access 2002 which comes in Office 2003 (go figure.)

I created the report by:  Clicked on Reports, clicked on New, Clicked on AutoReport Tabular.  Then I selected a Table whick has a few fields including one with the long lines of text.

I just did this again for a new report and it worked just fine, breaking on a word boundry.  I thought it did that the first time I tried this awhile back, too.  However, when I modified the length of the line in Design view it started chopping off the word.  I don't know why.  Perhaps you have an idea.  Either way I will accept your solution since that is just how I want it to work.

Avatar of ljcor

ASKER

Thanks, Peter.
I have tried messing around with the size of the textbox but can't create a problem except when it is so narrow that the whole word does not fit on one line. Otherwise it is consistently breaking on a word boundary.
Sorry I can't throw any light on the problem.
Avatar of ljcor

ASKER

Good enough.   I will just do it all over again - particularly since it is no problem.  Thanks again.