Solved

using word wrap in a Acess report text box

Posted on 2008-06-10
11
1,152 Views
Last Modified: 2012-06-21
Is there a way to word wrap in a Access report text box?  I have the can grow property excange set to true but i want it to to expand horizontally after a certain amount of records are writen. now it does this:

Troy smith
walter anderson
bill jones
Ron walterson
joe Brown
Ken Mertal

I want it to do this:

Troy smith            walter anderson
bill jones               Ron walterson
joe Brown            Ken Mertal
0
Comment
Question by:troyvw1
  • 5
  • 5
11 Comments
 
LVL 75
ID: 21753641
Not unless you get clever with Line Feeds Chr(10) and Carriage Returns Chr(13)

mx
0
 
LVL 75
ID: 21753646
Are those names all in one Memo field?

mx
0
 

Author Comment

by:troyvw1
ID: 21753795
DatabaseMX:

yeah they are all in one memo field in the database field - on the report i am using a text box control to display them
0
 

Author Comment

by:troyvw1
ID: 21753829
they are saved to the database with new lines per name but it is messing up some of my reports if the list is growing to long veritically so now i need them to spill over onto the next line.
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 500 total points
ID: 21753850
Well, unless you re-write them to the Memo field with two names per line, there is no way I can see how you would control that in any easy way.

mx
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:troyvw1
ID: 21753878
hmmm i was hoping for a word wrap option..
0
 
LVL 75
ID: 21754004
Well .. text boxes by default 'word wrap'.  I suppose with some clever code, etc., you might somehow be able to make this happen, but ... you data is already stored in one field ... with LFCR after each name, right?

If so, you can see the problem ... you would have to parse out every two - get rid of the LFCR - and put it after every two - instead of every one name.

mx
0
 
LVL 58

Expert Comment

by:harfang
ID: 21756378
What you are describing isn't "word wrap", it's "columnar output". You don't want to wrap to the next line, you want to use several columns.

That is possible and relatively easy for records: you can create a columnar subreport for that. For a memo field, it's a bit more complex: you will need to program that.

For example, create three text boxes and use the Format event to fill them out with the names any way you like.

Cheers!
(°v°)
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
 

    Dim Names() As String

    Dim i As Long

    

    txtCol1 = Null

    txtCol2 = Null

    txtCol3 = Null

    If IsNull(MyMemo) Then Exit Sub

    Names = Split(MyMemo, vbCrLf)

    For i = 0 To UBound(Names)

        With Me("txtCol" & i Mod 3 + 1)

            .Value = .Value + vbCrLf & Names(i)

        End With

    Next i

    

End Sub

Open in new window

0
 
LVL 75
ID: 21756529
lol.  Yep ... like I said ... some clever code AND some *different* controls ... and you are good to go :-)

mx
0
 

Author Comment

by:troyvw1
ID: 21761932
i am going to change the way the record gets intersted in the first place. Thank you.
0
 

Author Closing Comment

by:troyvw1
ID: 31465859
thank you for helping me think through this problem
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cross Tab with two column values 7 38
Sub Reports 8 23
Field Size - Double?  Want to display 0 5 31
ms/access vba - how to wait for a form to close 2 17
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

861 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now