using word wrap in a Acess report text box

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
troyvw1Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Connect With a Mentor Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Not unless you get clever with Line Feeds Chr(10) and Carriage Returns Chr(13)

mx
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Are those names all in one Memo field?

mx
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
troyvw1Author Commented:
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
 
troyvw1Author Commented:
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
 
troyvw1Author Commented:
hmmm i was hoping for a word wrap option..
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
harfangCommented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
lol.  Yep ... like I said ... some clever code AND some *different* controls ... and you are good to go :-)

mx
0
 
troyvw1Author Commented:
i am going to change the way the record gets intersted in the first place. Thank you.
0
 
troyvw1Author Commented:
thank you for helping me think through this problem
0
All Courses

From novice to tech pro — start learning today.