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

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
 
L

Les

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top