Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate List into a Single Text Boxt

Status
Not open for further replies.

muumigirl

MIS
Nov 23, 2003
5
EE
I have a problem and i found a solution that almost solves it.
I have a table with letter numbers and comments. This code summarizes all comments, but i need to show in report particular letter’s comments in one row. Does anyone know how to help me?
Code:
Public Function GetAcctMgrString() As String
Dim strTemp As String
Dim rs As Recordset

Set rs = CurrentDb.OpenRecordset("tableNameHere", dbOpenSnapshot)

With rs
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
strTemp = strTemp & !FieldNameHere & ", "
.MoveNext
Loop
strTemp = Left(strTemp, Len(strTemp) - 2)
GetAcctMgrString = strTemp
.Close
End If
End With
End Function
 
Do you mean that if you have three comments from three different records that you want each to start on it's own row? Your existing code will print as: "One, two, three, ..."
If you change to:
strTemp = strTemp & !FieldNameHere & vbCRLF
it will appear as:
One
Two
Three

Is this what you mean?


Learn from the mistakes of others. You won't live long enough to make all of them yourself.
 
There is this:
How to concatenate multiple child records into a single value
faq701-4233
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top