PC Review


Reply
Thread Tools Rate Thread

Access Reports - Word Wrapping in a Text Box

 
 
mattieflo
Guest
Posts: n/a
 
      18th Jul 2008
One of the requirements for one of our projects is for a text box in a
report, if they have something in the field like 'RFE_TRR_SEX' and it has to
wrap in the text box, that it wraps right after an underscore. Anyone have
any idea where to start on this one?
 
Reply With Quote
 
 
 
 
roger
Guest
Posts: n/a
 
      18th Jul 2008
an idea of where to start, sure:

You'll need to know how many characters will fit in a line
then you'l use an Instr() to find the last underscore before that number
then you use a left() to get a string upto that underscore
add a vbcrlf (hard return) and add the rest of the string with a Right()

its a little more complex if you have >2 lines

"mattieflo" wrote:

> One of the requirements for one of our projects is for a text box in a
> report, if they have something in the field like 'RFE_TRR_SEX' and it has to
> wrap in the text box, that it wraps right after an underscore. Anyone have
> any idea where to start on this one?

 
Reply With Quote
 
Jim Burke in Novi
Guest
Posts: n/a
 
      18th Jul 2008
If you want 'RFE_TRR_SEX' to appear as

RFE
TRR
SEX

then the split function should help you do that. Define an array (it may
have to be type VAriant, not positive about that), then do something like:

myArray = Split(myFIeld, "_")
txtField = vbnullstring
for i = 0 to ubound(myArray) - 1
if i > 0 then
txtField = txtField & vbcrlf
end if
txtField = txtField & myArray(i)
next i

Something along those lines should work, if you're looking for the result I
mentioned above.


"mattieflo" wrote:

> One of the requirements for one of our projects is for a text box in a
> report, if they have something in the field like 'RFE_TRR_SEX' and it has to
> wrap in the text box, that it wraps right after an underscore. Anyone have
> any idea where to start on this one?

 
Reply With Quote
 
mattieflo
Guest
Posts: n/a
 
      21st Jul 2008
Both ideas sound great. Thanks guys, im going to try both of them right now.

"Jim Burke in Novi" wrote:

> If you want 'RFE_TRR_SEX' to appear as
>
> RFE
> TRR
> SEX
>
> then the split function should help you do that. Define an array (it may
> have to be type VAriant, not positive about that), then do something like:
>
> myArray = Split(myFIeld, "_")
> txtField = vbnullstring
> for i = 0 to ubound(myArray) - 1
> if i > 0 then
> txtField = txtField & vbcrlf
> end if
> txtField = txtField & myArray(i)
> next i
>
> Something along those lines should work, if you're looking for the result I
> mentioned above.
>
>
> "mattieflo" wrote:
>
> > One of the requirements for one of our projects is for a text box in a
> > report, if they have something in the field like 'RFE_TRR_SEX' and it has to
> > wrap in the text box, that it wraps right after an underscore. Anyone have
> > any idea where to start on this one?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
word wrapping text dbourke7 Microsoft Word Document Management 4 4th Jun 2008 02:24 PM
wrapping text in Microsoft Access reports =?Utf-8?B?Q2Fyb2xyYXdpbmlh?= Microsoft Access Reports 1 19th Oct 2006 05:09 AM
word wrapping in text fields for Access? =?Utf-8?B?VG9tIEJhdXJsZXk=?= Microsoft Access Form Coding 3 23rd May 2006 08:22 PM
Wrapping in Access 2000 reports Mickey Microsoft Access Reports 2 20th Oct 2004 04:33 PM
Word Wrapping Text Sonya Microsoft Excel New Users 2 26th Feb 2004 03:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:27 PM.