How to insert "Manual Line Break" in querry results.

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

I have a querry that has the following two columns:
1. StudentID
2. StudentDetails

The column StudentDetails invokes a VBA
function "Concatenate" to obtain the results from two
tables based on StudentID.

Sample Result:

StudentID StudentDetails
1 StudentID:1, NoOfSubjects:2, StudentID--1-
-SubjectID--1--64, StudentID--1--SubjectID--2--85

Desired result:

StudentID StudentDetails
1 StudentID:1,
NoOfSubjects:5,
StudentID--1--SubjectID--1--64
StudentID--1--SubjectID--2--85

Is there any way to insert a special character for line
breaks and tabs (like ^I in MS-WORD for manual line
break) in the querry results (i.e mean inside the VBA
function), so that when I export the query results to MS-
Excel or MS-Word the results appear formatted.

Pls help.

Thanks
 
Try inserting CHR(13) & CHR(10) in your concatenation,
where you want the line breaks to occur.
 
Back
Top