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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing carriage return to Word form

Status
Not open for further replies.

Kneely

Technical User
Feb 12, 2001
2
US
I am trying to merge a Access recordset to a Word form field inserting a carriage return/line feed after each record. The merge performs correctly, except that an empty box appears in the Word formfield where the carriage return/ line feed should be. I am looping throug the recordset using the following code:

Do Until rs.EOF
strNames = strNames & rs("Names").Value & Chr(13) & Chr(10)
rs.MoveNext
Loop

I've tried using the vbCRLF constant, but get the same result. I also tried inserting ^p (the Word control character for carriage return) using Chr(94) & Chr(112), but that results in ^p being inserted as text rather than causing a carriage return as desired.

Any ideas?
 
Tried Chr(10) and still get the empty box. (Actually, when "Chr(13)& Chr(10)" are used, I get 2 empty boxes.)

Thanks for the suggestion, though. Any other thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top