Using Office XP I am populating formfields on a Word
template from a query in Access. Everything works fine,
but when I attempt to do a line-feed, all I get is a
little box. I have tried both Chr(10) and Chr(13) for
line feed and carriage return. Other Chr codes work. Chr
(36) produces a dollar sign, etc.

How can I do a line feed in a formfield with code?

Thanks in advance.

Steve

Re: Chr(10) does not produce linefeed in formfield by Doug

Doug
Mon Jan 26 00:34:06 CST 2004

Hi Steve,

Use vbCr

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"Steve T" <stevet8@comcast.net> wrote in message
news:3cc201c3e3c3$95a62f50$a101280a@phx.gbl...
> Using Office XP I am populating formfields on a Word
> template from a query in Access. Everything works fine,
> but when I attempt to do a line-feed, all I get is a
> little box. I have tried both Chr(10) and Chr(13) for
> line feed and carriage return. Other Chr codes work. Chr
> (36) produces a dollar sign, etc.
>
> How can I do a line feed in a formfield with code?
>
> Thanks in advance.
>
> Steve



Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Mon Jan 26 15:32:06 CST 2004

Thanks, Doug, but that didn't work either.
I'm thinking the problem is that I'm in a form field.

This is the code I'm using to open a Word template and
automatically populate a form field with information in
an Access recordset. The recordset is a list of
victims's names, addresses, and phone numbers. I want to
loop throught the records, giving a number to each
victim. Usually there's no more than 2 or 3, but I want
them on separate lines. This information populates a
form field called "Victims" in the Word document.
CODE:

Dim oDoc As Word.Document
Dim strVictims As String
Dim rst1 As ADODB.Recordset
Dim i As Integer
i = 1
Set rst1 = New ADODB.Recordset
rst1.Open "SELECT entryID, fullname, address,
txtphone " _
& "FROM qryVictimNames WHERE entryID = " &
Me.txtEntryID, _
CurrentProject.Connection
Do Until rst1.EOF
strVictims = strVictims & "#" & i & "-" & rst1!
FullName & " " & rst1!Address & " " & _
rst1!txtphone & Chr(10) 'or vbCR or
everything else I've tried
i = i + 1
rst1.MoveNext

Loop
rst1.Close
Set rst1 = Nothing


Set oDoc = oSupp.Documents.Add
("Z:\templates\AccessSuppRpt.dot")
With oDoc
.FormFields("victims").Result = strVictims
' Other formfields are populated similarly..
End With
oSupp.Visible = True



>-----Original Message-----
>Using Office XP I am populating formfields on a Word
>template from a query in Access. Everything works fine,
>but when I attempt to do a line-feed, all I get is a
>little box. I have tried both Chr(10) and Chr(13) for
>line feed and carriage return. Other Chr codes work.
Chr
>(36) produces a dollar sign, etc.
>
>How can I do a line feed in a formfield with code?
>
>Thanks in advance.
>
>Steve
>.
>

Re: Chr(10) does not produce linefeed in formfield by Perry

Perry
Mon Jan 26 15:38:28 CST 2004

I suppose

vbCrLf

didn't help either?

Krgrds,
Perry

"SteveT" <SteveT8@comcast.net> wrote in message
news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
> Thanks, Doug, but that didn't work either.
> I'm thinking the problem is that I'm in a form field.
>
> This is the code I'm using to open a Word template and
> automatically populate a form field with information in
> an Access recordset. The recordset is a list of
> victims's names, addresses, and phone numbers. I want to
> loop throught the records, giving a number to each
> victim. Usually there's no more than 2 or 3, but I want
> them on separate lines. This information populates a
> form field called "Victims" in the Word document.
> CODE:
>
> Dim oDoc As Word.Document
> Dim strVictims As String
> Dim rst1 As ADODB.Recordset
> Dim i As Integer
> i = 1
> Set rst1 = New ADODB.Recordset
> rst1.Open "SELECT entryID, fullname, address,
> txtphone " _
> & "FROM qryVictimNames WHERE entryID = " &
> Me.txtEntryID, _
> CurrentProject.Connection
> Do Until rst1.EOF
> strVictims = strVictims & "#" & i & "-" & rst1!
> FullName & " " & rst1!Address & " " & _
> rst1!txtphone & Chr(10) 'or vbCR or
> everything else I've tried
> i = i + 1
> rst1.MoveNext
>
> Loop
> rst1.Close
> Set rst1 = Nothing
>
>
> Set oDoc = oSupp.Documents.Add
> ("Z:\templates\AccessSuppRpt.dot")
> With oDoc
> .FormFields("victims").Result = strVictims
> ' Other formfields are populated similarly..
> End With
> oSupp.Visible = True
>
>
>
> >-----Original Message-----
> >Using Office XP I am populating formfields on a Word
> >template from a query in Access. Everything works fine,
> >but when I attempt to do a line-feed, all I get is a
> >little box. I have tried both Chr(10) and Chr(13) for
> >line feed and carriage return. Other Chr codes work.
> Chr
> >(36) produces a dollar sign, etc.
> >
> >How can I do a line feed in a formfield with code?
> >
> >Thanks in advance.
> >
> >Steve
> >.
> >



Re: Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Mon Jan 26 16:35:13 CST 2004

I've tried vbCr and it gives me the same thing as Chr
(10), a little square box. I also tried vbKeyReturn the
VBA constant for ENTER, and that gives me the number 138
in the form field, but everything still stays on the same
line. Any ideas?

Thanks in advance..


>-----Original Message-----
>Hi Steve,
>
>Use vbCr
>
>--
>Please post any further questions or followup to the
newsgroups for the
>benefit of others who may be interested. Unsolicited
questions forwarded
>directly to me will only be answered on a paid
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"Steve T" <stevet8@comcast.net> wrote in message
>news:3cc201c3e3c3$95a62f50$a101280a@phx.gbl...
>> Using Office XP I am populating formfields on a Word
>> template from a query in Access. Everything works
fine,
>> but when I attempt to do a line-feed, all I get is a
>> little box. I have tried both Chr(10) and Chr(13) for
>> line feed and carriage return. Other Chr codes work.
Chr
>> (36) produces a dollar sign, etc.
>>
>> How can I do a line feed in a formfield with code?
>>
>> Thanks in advance.
>>
>> Steve
>
>
>.
>

Re: Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Tue Jan 27 00:24:57 CST 2004

No, Perry, but thanks for trying. vbCrLf gave me TWO
little boxes in my string, but no linefeed.

I'm thinking it may have something to do with being in a
form field, but when I'm in the form I can start a new
line while in the field by hitting the ENTER key. But I
can't find a way to do it from code.

I also tried vbKeyReturn the VBA constant for the ENTER
key, and that returned a "13" in the string. ?????

>-----Original Message-----
>I suppose
>
>vbCrLf
>
>didn't help either?
>
>Krgrds,
>Perry
>
>"SteveT" <SteveT8@comcast.net> wrote in message
>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>> Thanks, Doug, but that didn't work either.
>> I'm thinking the problem is that I'm in a form field.
>>
>> This is the code I'm using to open a Word template and
>> automatically populate a form field with information in
>> an Access recordset. The recordset is a list of
>> victims's names, addresses, and phone numbers. I want
to
>> loop throught the records, giving a number to each
>> victim. Usually there's no more than 2 or 3, but I want
>> them on separate lines. This information populates a
>> form field called "Victims" in the Word document.
>> CODE:
>>
>> Dim oDoc As Word.Document
>> Dim strVictims As String
>> Dim rst1 As ADODB.Recordset
>> Dim i As Integer
>> i = 1
>> Set rst1 = New ADODB.Recordset
>> rst1.Open "SELECT entryID, fullname, address,
>> txtphone " _
>> & "FROM qryVictimNames WHERE entryID = " &
>> Me.txtEntryID, _
>> CurrentProject.Connection
>> Do Until rst1.EOF
>> strVictims = strVictims & "#" & i & "-" & rst1!
>> FullName & " " & rst1!Address & " " & _
>> rst1!txtphone & Chr(10) 'or vbCR or
>> everything else I've tried
>> i = i + 1
>> rst1.MoveNext
>>
>> Loop
>> rst1.Close
>> Set rst1 = Nothing
>>
>>
>> Set oDoc = oSupp.Documents.Add
>> ("Z:\templates\AccessSuppRpt.dot")
>> With oDoc
>> .FormFields("victims").Result = strVictims
>> ' Other formfields are populated similarly..
>> End With
>> oSupp.Visible = True
>>
>>
>>
>> >-----Original Message-----
>> >Using Office XP I am populating formfields on a Word
>> >template from a query in Access. Everything works
fine,
>> >but when I attempt to do a line-feed, all I get is a
>> >little box. I have tried both Chr(10) and Chr(13) for
>> >line feed and carriage return. Other Chr codes work.
>> Chr
>> >(36) produces a dollar sign, etc.
>> >
>> >How can I do a line feed in a formfield with code?
>> >
>> >Thanks in advance.
>> >
>> >Steve
>> >.
>> >
>
>
>.
>

Re: Chr(10) does not produce linefeed in formfield by Doug

Doug
Tue Jan 27 03:17:24 CST 2004

Hi Steve,

I am sure that it is not because of your trying to insert it into a
formfield because if a macro containing the following code is run on exit
from the formfield "Text1", the result is

lineone¶
linetwo

Instead of trying to build a string containing all of the records, you may
need to create the document and populate the formfield by using


Do Until rst1.EOF
If oDoc.FormFields("victims").Result = "" then
odDoc.FormFields("victims").Result = strVictims & "#" & i & "-" &
rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
Else
odDoc.FormFields("victims").Result =
odDoc.FormFields("victims").Result & vbCr &strVictims & "#" & i & "-" &
rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
End If
i = i + 1
rst1.MoveNext
Loop


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"SteveT" <SteveT8@comcast.net> wrote in message
news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
> Thanks, Doug, but that didn't work either.
> I'm thinking the problem is that I'm in a form field.
>
> This is the code I'm using to open a Word template and
> automatically populate a form field with information in
> an Access recordset. The recordset is a list of
> victims's names, addresses, and phone numbers. I want to
> loop throught the records, giving a number to each
> victim. Usually there's no more than 2 or 3, but I want
> them on separate lines. This information populates a
> form field called "Victims" in the Word document.
> CODE:
>
> Dim oDoc As Word.Document
> Dim strVictims As String
> Dim rst1 As ADODB.Recordset
> Dim i As Integer
> i = 1
> Set rst1 = New ADODB.Recordset
> rst1.Open "SELECT entryID, fullname, address,
> txtphone " _
> & "FROM qryVictimNames WHERE entryID = " &
> Me.txtEntryID, _
> CurrentProject.Connection
> Do Until rst1.EOF
> strVictims = strVictims & "#" & i & "-" & rst1!
> FullName & " " & rst1!Address & " " & _
> rst1!txtphone & Chr(10) 'or vbCR or
> everything else I've tried
> i = i + 1
> rst1.MoveNext
>
> Loop
> rst1.Close
> Set rst1 = Nothing
>
>
> Set oDoc = oSupp.Documents.Add
> ("Z:\templates\AccessSuppRpt.dot")
> With oDoc
> .FormFields("victims").Result = strVictims
> ' Other formfields are populated similarly..
> End With
> oSupp.Visible = True
>
>
>
>>-----Original Message-----
>>Using Office XP I am populating formfields on a Word
>>template from a query in Access. Everything works fine,
>>but when I attempt to do a line-feed, all I get is a
>>little box. I have tried both Chr(10) and Chr(13) for
>>line feed and carriage return. Other Chr codes work.
> Chr
>>(36) produces a dollar sign, etc.
>>
>>How can I do a line feed in a formfield with code?
>>
>>Thanks in advance.
>>
>>Steve
>>.
>>



Re: Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Tue Jan 27 11:27:18 CST 2004

Thanks, Doug, for your suggested code. It was a=20
different way of doing this, but produced the same=20
results. With two victims in my data base, your=20
suggested code put them both on the same line.

In frustration,
Steve

>-----Original Message-----
>Hi Steve,
>
>I am sure that it is not because of your trying to=20
insert it into a=20
>formfield because if a macro containing the following=20
code is run on exit=20
>from the formfield "Text1", the result is
>
>lineone=B6
>linetwo
>
>Instead of trying to build a string containing all of=20
the records, you may=20
>need to create the document and populate the formfield=20
by using
>
>
>Do Until rst1.EOF
> If oDoc.FormFields("victims").Result =3D "" then
> odDoc.FormFields("victims").Result =3D strVictims=20
& "#" & i & "-" &=20
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> Else
> odDoc.FormFields("victims").Result =3D=20
>odDoc.FormFields("victims").Result & vbCr &strVictims=20
& "#" & i & "-" &=20
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> End If
> i =3D i + 1
> rst1.MoveNext
>Loop
>
>
>--=20
>Please post any further questions or followup to the=20
newsgroups for the=20
>benefit of others who may be interested. Unsolicited=20
questions forwarded=20
>directly to me will only be answered on a paid=20
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"SteveT" <SteveT8@comcast.net> wrote in message=20
>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>> Thanks, Doug, but that didn't work either.
>> I'm thinking the problem is that I'm in a form field.
>>
>> This is the code I'm using to open a Word template and
>> automatically populate a form field with information in
>> an Access recordset. The recordset is a list of
>> victims's names, addresses, and phone numbers. I want=20
to
>> loop throught the records, giving a number to each
>> victim. Usually there's no more than 2 or 3, but I want
>> them on separate lines. This information populates a
>> form field called "Victims" in the Word document.
>> CODE:
>>
>> Dim oDoc As Word.Document
>> Dim strVictims As String
>> Dim rst1 As ADODB.Recordset
>> Dim i As Integer
>> i =3D 1
>> Set rst1 =3D New ADODB.Recordset
>> rst1.Open "SELECT entryID, fullname, address,
>> txtphone " _
>> & "FROM qryVictimNames WHERE entryID =3D " &
>> Me.txtEntryID, _
>> CurrentProject.Connection
>> Do Until rst1.EOF
>> strVictims =3D strVictims & "#" & i & "-" & rst1!
>> FullName & " " & rst1!Address & " " & _
>> rst1!txtphone & Chr(10) 'or vbCR or
>> everything else I've tried
>> i =3D i + 1
>> rst1.MoveNext
>>
>> Loop
>> rst1.Close
>> Set rst1 =3D Nothing
>>
>>
>> Set oDoc =3D oSupp.Documents.Add
>> ("Z:\templates\AccessSuppRpt.dot")
>> With oDoc
>> .FormFields("victims").Result =3D strVictims
>> ' Other formfields are populated similarly..
>> End With
>> oSupp.Visible =3D True
>>
>>
>>
>>>-----Original Message-----
>>>Using Office XP I am populating formfields on a Word
>>>template from a query in Access. Everything works=20
fine,
>>>but when I attempt to do a line-feed, all I get is a
>>>little box. I have tried both Chr(10) and Chr(13) for
>>>line feed and carriage return. Other Chr codes work.
>> Chr
>>>(36) produces a dollar sign, etc.
>>>
>>>How can I do a line feed in a formfield with code?
>>>
>>>Thanks in advance.
>>>
>>>Steve
>>>.
>>>=20
>
>
>.
>

Re: Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Tue Jan 27 11:51:00 CST 2004

I just noticed something peculiar, Doug.
After I populate the Word document, using your code, the=20
result with two records is the first string, a small box,=20
then the second string--all on one line.

If I put the cursor in front of the small box character=20
and hit ENTER, the second string moves down TWO lines and=20
the little box disappears.

In other words, the line feed is there, it just doesn't=20
activate. When I place another one in manually, the=20
first one activates as well.

On a whim I formatted the field to calculate on exit, but=20
that didn't help.

I think we're dealing with a bug.

What do you think?

Steve
>-----Original Message-----
>Hi Steve,
>
>I am sure that it is not because of your trying to=20
insert it into a=20
>formfield because if a macro containing the following=20
code is run on exit=20
>from the formfield "Text1", the result is
>
>lineone=B6
>linetwo
>
>Instead of trying to build a string containing all of=20
the records, you may=20
>need to create the document and populate the formfield=20
by using
>
>
>Do Until rst1.EOF
> If oDoc.FormFields("victims").Result =3D "" then
> odDoc.FormFields("victims").Result =3D strVictims=20
& "#" & i & "-" &=20
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> Else
> odDoc.FormFields("victims").Result =3D=20
>odDoc.FormFields("victims").Result & vbCr &strVictims=20
& "#" & i & "-" &=20
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> End If
> i =3D i + 1
> rst1.MoveNext
>Loop
>
>
>--=20
>Please post any further questions or followup to the=20
newsgroups for the=20
>benefit of others who may be interested. Unsolicited=20
questions forwarded=20
>directly to me will only be answered on a paid=20
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"SteveT" <SteveT8@comcast.net> wrote in message=20
>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>> Thanks, Doug, but that didn't work either.
>> I'm thinking the problem is that I'm in a form field.
>>
>> This is the code I'm using to open a Word template and
>> automatically populate a form field with information in
>> an Access recordset. The recordset is a list of
>> victims's names, addresses, and phone numbers. I want=20
to
>> loop throught the records, giving a number to each
>> victim. Usually there's no more than 2 or 3, but I want
>> them on separate lines. This information populates a
>> form field called "Victims" in the Word document.
>> CODE:
>>
>> Dim oDoc As Word.Document
>> Dim strVictims As String
>> Dim rst1 As ADODB.Recordset
>> Dim i As Integer
>> i =3D 1
>> Set rst1 =3D New ADODB.Recordset
>> rst1.Open "SELECT entryID, fullname, address,
>> txtphone " _
>> & "FROM qryVictimNames WHERE entryID =3D " &
>> Me.txtEntryID, _
>> CurrentProject.Connection
>> Do Until rst1.EOF
>> strVictims =3D strVictims & "#" & i & "-" & rst1!
>> FullName & " " & rst1!Address & " " & _
>> rst1!txtphone & Chr(10) 'or vbCR or
>> everything else I've tried
>> i =3D i + 1
>> rst1.MoveNext
>>
>> Loop
>> rst1.Close
>> Set rst1 =3D Nothing
>>
>>
>> Set oDoc =3D oSupp.Documents.Add
>> ("Z:\templates\AccessSuppRpt.dot")
>> With oDoc
>> .FormFields("victims").Result =3D strVictims
>> ' Other formfields are populated similarly..
>> End With
>> oSupp.Visible =3D True
>>
>>
>>
>>>-----Original Message-----
>>>Using Office XP I am populating formfields on a Word
>>>template from a query in Access. Everything works=20
fine,
>>>but when I attempt to do a line-feed, all I get is a
>>>little box. I have tried both Chr(10) and Chr(13) for
>>>line feed and carriage return. Other Chr codes work.
>> Chr
>>>(36) produces a dollar sign, etc.
>>>
>>>How can I do a line feed in a formfield with code?
>>>
>>>Thanks in advance.
>>>
>>>Steve
>>>.
>>>=20
>
>
>.
>

Re: Chr(10) does not produce linefeed in formfield by Lars-Eric

Lars-Eric
Tue Jan 27 12:46:32 CST 2004

Steve,

Use Chr(11)

--
Regards,
Lars-Eric Gisslén

"SteveT" <SteveT8@comcast.net> skrev i meddelandet
news:4dab01c3e4fa$d05368b0$a101280a@phx.gbl...
Thanks, Doug, for your suggested code. It was a
different way of doing this, but produced the same
results. With two victims in my data base, your
suggested code put them both on the same line.

In frustration,
Steve

>-----Original Message-----
>Hi Steve,
>
>I am sure that it is not because of your trying to
insert it into a
>formfield because if a macro containing the following
code is run on exit
>from the formfield "Text1", the result is
>
>lineone¶
>linetwo
>
>Instead of trying to build a string containing all of
the records, you may
>need to create the document and populate the formfield
by using
>
>
>Do Until rst1.EOF
> If oDoc.FormFields("victims").Result = "" then
> odDoc.FormFields("victims").Result = strVictims
& "#" & i & "-" &
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> Else
> odDoc.FormFields("victims").Result =
>odDoc.FormFields("victims").Result & vbCr &strVictims
& "#" & i & "-" &
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> End If
> i = i + 1
> rst1.MoveNext
>Loop
>
>
>--
>Please post any further questions or followup to the
newsgroups for the
>benefit of others who may be interested. Unsolicited
questions forwarded
>directly to me will only be answered on a paid
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"SteveT" <SteveT8@comcast.net> wrote in message
>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>> Thanks, Doug, but that didn't work either.
>> I'm thinking the problem is that I'm in a form field.
>>
>> This is the code I'm using to open a Word template and
>> automatically populate a form field with information in
>> an Access recordset. The recordset is a list of
>> victims's names, addresses, and phone numbers. I want
to
>> loop throught the records, giving a number to each
>> victim. Usually there's no more than 2 or 3, but I want
>> them on separate lines. This information populates a
>> form field called "Victims" in the Word document.
>> CODE:
>>
>> Dim oDoc As Word.Document
>> Dim strVictims As String
>> Dim rst1 As ADODB.Recordset
>> Dim i As Integer
>> i = 1
>> Set rst1 = New ADODB.Recordset
>> rst1.Open "SELECT entryID, fullname, address,
>> txtphone " _
>> & "FROM qryVictimNames WHERE entryID = " &
>> Me.txtEntryID, _
>> CurrentProject.Connection
>> Do Until rst1.EOF
>> strVictims = strVictims & "#" & i & "-" & rst1!
>> FullName & " " & rst1!Address & " " & _
>> rst1!txtphone & Chr(10) 'or vbCR or
>> everything else I've tried
>> i = i + 1
>> rst1.MoveNext
>>
>> Loop
>> rst1.Close
>> Set rst1 = Nothing
>>
>>
>> Set oDoc = oSupp.Documents.Add
>> ("Z:\templates\AccessSuppRpt.dot")
>> With oDoc
>> .FormFields("victims").Result = strVictims
>> ' Other formfields are populated similarly..
>> End With
>> oSupp.Visible = True
>>
>>
>>
>>>-----Original Message-----
>>>Using Office XP I am populating formfields on a Word
>>>template from a query in Access. Everything works
fine,
>>>but when I attempt to do a line-feed, all I get is a
>>>little box. I have tried both Chr(10) and Chr(13) for
>>>line feed and carriage return. Other Chr codes work.
>> Chr
>>>(36) produces a dollar sign, etc.
>>>
>>>How can I do a line feed in a formfield with code?
>>>
>>>Thanks in advance.
>>>
>>>Steve
>>>.
>>>
>
>
>.
>



Re: Chr(10) does not produce linefeed in formfield by Doug

Doug
Wed Jan 28 02:50:48 CST 2004

Hi Steve,

Not having your database to use, I set up a document with a couple of
formfields with one of them having the bookmark name of victioms and had a
macro containing the following code run on exit from that formfield.

Dim i As Long, oDoc As Document
Set oDoc = ActiveDocument
For i = 1 To 10
If oDoc.FormFields("victims").Result = "" Then
oDoc.FormFields("victims").Result = "Item" & i
Else
oDoc.FormFields("victims").Result =
oDoc.FormFields("victims").Result & vbCr & "Item" & i
End If
Next i

It populated the formfield with

Item1¶
Item2¶
...
...
Item10¶

That was after I corrected the couple of typos in the code that I had
suggested (oDoc and odDoc)
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"SteveT" <SteveT8@comcast.net> wrote in message
news:4c9301c3e4fe$20148e30$a301280a@phx.gbl...
I just noticed something peculiar, Doug.
After I populate the Word document, using your code, the
result with two records is the first string, a small box,
then the second string--all on one line.

If I put the cursor in front of the small box character
and hit ENTER, the second string moves down TWO lines and
the little box disappears.

In other words, the line feed is there, it just doesn't
activate. When I place another one in manually, the
first one activates as well.

On a whim I formatted the field to calculate on exit, but
that didn't help.

I think we're dealing with a bug.

What do you think?

Steve
>-----Original Message-----
>Hi Steve,
>
>I am sure that it is not because of your trying to
insert it into a
>formfield because if a macro containing the following
code is run on exit
>from the formfield "Text1", the result is
>
>lineone¶
>linetwo
>
>Instead of trying to build a string containing all of
the records, you may
>need to create the document and populate the formfield
by using
>
>
>Do Until rst1.EOF
> If oDoc.FormFields("victims").Result = "" then
> odDoc.FormFields("victims").Result = strVictims
& "#" & i & "-" &
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> Else
> odDoc.FormFields("victims").Result =
>odDoc.FormFields("victims").Result & vbCr &strVictims
& "#" & i & "-" &
>rst1!FullName & " " & rst1!Address & " " & rst1!txtphone
> End If
> i = i + 1
> rst1.MoveNext
>Loop
>
>
>--
>Please post any further questions or followup to the
newsgroups for the
>benefit of others who may be interested. Unsolicited
questions forwarded
>directly to me will only be answered on a paid
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"SteveT" <SteveT8@comcast.net> wrote in message
>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>> Thanks, Doug, but that didn't work either.
>> I'm thinking the problem is that I'm in a form field.
>>
>> This is the code I'm using to open a Word template and
>> automatically populate a form field with information in
>> an Access recordset. The recordset is a list of
>> victims's names, addresses, and phone numbers. I want
to
>> loop throught the records, giving a number to each
>> victim. Usually there's no more than 2 or 3, but I want
>> them on separate lines. This information populates a
>> form field called "Victims" in the Word document.
>> CODE:
>>
>> Dim oDoc As Word.Document
>> Dim strVictims As String
>> Dim rst1 As ADODB.Recordset
>> Dim i As Integer
>> i = 1
>> Set rst1 = New ADODB.Recordset
>> rst1.Open "SELECT entryID, fullname, address,
>> txtphone " _
>> & "FROM qryVictimNames WHERE entryID = " &
>> Me.txtEntryID, _
>> CurrentProject.Connection
>> Do Until rst1.EOF
>> strVictims = strVictims & "#" & i & "-" & rst1!
>> FullName & " " & rst1!Address & " " & _
>> rst1!txtphone & Chr(10) 'or vbCR or
>> everything else I've tried
>> i = i + 1
>> rst1.MoveNext
>>
>> Loop
>> rst1.Close
>> Set rst1 = Nothing
>>
>>
>> Set oDoc = oSupp.Documents.Add
>> ("Z:\templates\AccessSuppRpt.dot")
>> With oDoc
>> .FormFields("victims").Result = strVictims
>> ' Other formfields are populated similarly..
>> End With
>> oSupp.Visible = True
>>
>>
>>
>>>-----Original Message-----
>>>Using Office XP I am populating formfields on a Word
>>>template from a query in Access. Everything works
fine,
>>>but when I attempt to do a line-feed, all I get is a
>>>little box. I have tried both Chr(10) and Chr(13) for
>>>line feed and carriage return. Other Chr codes work.
>> Chr
>>>(36) produces a dollar sign, etc.
>>>
>>>How can I do a line feed in a formfield with code?
>>>
>>>Thanks in advance.
>>>
>>>Steve
>>>.
>>>
>
>
>.
>



Re: Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Wed Jan 28 10:50:38 CST 2004

Lars-Eric, You are my hero. I've never heard of a=20
vertical tab before, but it works.

I owe you a beer!

Steve
>-----Original Message-----
>Steve,
>
>Use Chr(11)
>
>--=20
>Regards,
>Lars-Eric Gissl=E9n
>
>"SteveT" <SteveT8@comcast.net> skrev i meddelandet
>news:4dab01c3e4fa$d05368b0$a101280a@phx.gbl...
>Thanks, Doug, for your suggested code. It was a
>different way of doing this, but produced the same
>results. With two victims in my data base, your
>suggested code put them both on the same line.
>
>In frustration,
>Steve
>
>>-----Original Message-----
>>Hi Steve,
>>
>>I am sure that it is not because of your trying to
>insert it into a
>>formfield because if a macro containing the following
>code is run on exit
>>from the formfield "Text1", the result is
>>
>>lineone=B6
>>linetwo
>>
>>Instead of trying to build a string containing all of
>the records, you may
>>need to create the document and populate the formfield
>by using
>>
>>
>>Do Until rst1.EOF
>> If oDoc.FormFields("victims").Result =3D "" then
>> odDoc.FormFields("victims").Result =3D strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> Else
>> odDoc.FormFields("victims").Result =3D
>>odDoc.FormFields("victims").Result & vbCr &strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> End If
>> i =3D i + 1
>> rst1.MoveNext
>>Loop
>>
>>
>>--=20
>>Please post any further questions or followup to the
>newsgroups for the
>>benefit of others who may be interested. Unsolicited
>questions forwarded
>>directly to me will only be answered on a paid
>consulting basis.
>>Hope this helps
>>Doug Robbins - Word MVP
>>"SteveT" <SteveT8@comcast.net> wrote in message
>>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>>> Thanks, Doug, but that didn't work either.
>>> I'm thinking the problem is that I'm in a form field.
>>>
>>> This is the code I'm using to open a Word template and
>>> automatically populate a form field with information=20
in
>>> an Access recordset. The recordset is a list of
>>> victims's names, addresses, and phone numbers. I want
>to
>>> loop throught the records, giving a number to each
>>> victim. Usually there's no more than 2 or 3, but I=20
want
>>> them on separate lines. This information populates a
>>> form field called "Victims" in the Word document.
>>> CODE:
>>>
>>> Dim oDoc As Word.Document
>>> Dim strVictims As String
>>> Dim rst1 As ADODB.Recordset
>>> Dim i As Integer
>>> i =3D 1
>>> Set rst1 =3D New ADODB.Recordset
>>> rst1.Open "SELECT entryID, fullname, address,
>>> txtphone " _
>>> & "FROM qryVictimNames WHERE entryID =3D " &
>>> Me.txtEntryID, _
>>> CurrentProject.Connection
>>> Do Until rst1.EOF
>>> strVictims =3D strVictims & "#" & i & "-" & rst1!
>>> FullName & " " & rst1!Address & " " & _
>>> rst1!txtphone & Chr(10) 'or vbCR or
>>> everything else I've tried
>>> i =3D i + 1
>>> rst1.MoveNext
>>>
>>> Loop
>>> rst1.Close
>>> Set rst1 =3D Nothing
>>>
>>>
>>> Set oDoc =3D oSupp.Documents.Add
>>> ("Z:\templates\AccessSuppRpt.dot")
>>> With oDoc
>>> .FormFields("victims").Result =3D strVictims
>>> ' Other formfields are populated similarly..
>>> End With
>>> oSupp.Visible =3D True
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>Using Office XP I am populating formfields on a Word
>>>>template from a query in Access. Everything works
>fine,
>>>>but when I attempt to do a line-feed, all I get is a
>>>>little box. I have tried both Chr(10) and Chr(13) for
>>>>line feed and carriage return. Other Chr codes work.
>>> Chr
>>>>(36) produces a dollar sign, etc.
>>>>
>>>>How can I do a line feed in a formfield with code?
>>>>
>>>>Thanks in advance.
>>>>
>>>>Steve
>>>>.
>>>>
>>
>>
>>.
>>
>
>
>.
>

Re: Chr(10) does not produce linefeed in formfield by SteveT

SteveT
Wed Jan 28 11:02:11 CST 2004

Doug--
Thanks for you efforts, I know you spent some time on my=20
problem. It may have something to do with sending the=20
code from an MS Access form. Nothing worked until I=20
tried the vertical tab, Chr(11), as suggested by Lars-
Eric.

Steve
>-----Original Message-----
>Hi Steve,
>
>Not having your database to use, I set up a document=20
with a couple of=20
>formfields with one of them having the bookmark name of=20
victioms and had a=20
>macro containing the following code run on exit from=20
that formfield.
>
>Dim i As Long, oDoc As Document
>Set oDoc =3D ActiveDocument
>For i =3D 1 To 10
> If oDoc.FormFields("victims").Result =3D "" Then
> oDoc.FormFields("victims").Result =3D "Item" & i
> Else
> oDoc.FormFields("victims").Result =3D=20
>oDoc.FormFields("victims").Result & vbCr & "Item" & i
> End If
>Next i
>
>It populated the formfield with
>
>Item1=B6
>Item2=B6
>....
>....
>Item10=B6
>
>That was after I corrected the couple of typos in the=20
code that I had=20
>suggested (oDoc and odDoc)
>--=20
>Please post any further questions or followup to the=20
newsgroups for the=20
>benefit of others who may be interested. Unsolicited=20
questions forwarded=20
>directly to me will only be answered on a paid=20
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"SteveT" <SteveT8@comcast.net> wrote in message=20
>news:4c9301c3e4fe$20148e30$a301280a@phx.gbl...
>I just noticed something peculiar, Doug.
>After I populate the Word document, using your code, the
>result with two records is the first string, a small box,
>then the second string--all on one line.
>
>If I put the cursor in front of the small box character
>and hit ENTER, the second string moves down TWO lines and
>the little box disappears.
>
>In other words, the line feed is there, it just doesn't
>activate. When I place another one in manually, the
>first one activates as well.
>
>On a whim I formatted the field to calculate on exit, but
>that didn't help.
>
>I think we're dealing with a bug.
>
>What do you think?
>
>Steve
>>-----Original Message-----
>>Hi Steve,
>>
>>I am sure that it is not because of your trying to
>insert it into a
>>formfield because if a macro containing the following
>code is run on exit
>>from the formfield "Text1", the result is
>>
>>lineone=B6
>>linetwo
>>
>>Instead of trying to build a string containing all of
>the records, you may
>>need to create the document and populate the formfield
>by using
>>
>>
>>Do Until rst1.EOF
>> If oDoc.FormFields("victims").Result =3D "" then
>> odDoc.FormFields("victims").Result =3D strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> Else
>> odDoc.FormFields("victims").Result =3D
>>odDoc.FormFields("victims").Result & vbCr &strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> End If
>> i =3D i + 1
>> rst1.MoveNext
>>Loop
>>
>>
>>--=20
>>Please post any further questions or followup to the
>newsgroups for the
>>benefit of others who may be interested. Unsolicited
>questions forwarded
>>directly to me will only be answered on a paid
>consulting basis.
>>Hope this helps
>>Doug Robbins - Word MVP
>>"SteveT" <SteveT8@comcast.net> wrote in message
>>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>>> Thanks, Doug, but that didn't work either.
>>> I'm thinking the problem is that I'm in a form field.
>>>
>>> This is the code I'm using to open a Word template and
>>> automatically populate a form field with information=20
in
>>> an Access recordset. The recordset is a list of
>>> victims's names, addresses, and phone numbers. I want
>to
>>> loop throught the records, giving a number to each
>>> victim. Usually there's no more than 2 or 3, but I=20
want
>>> them on separate lines. This information populates a
>>> form field called "Victims" in the Word document.
>>> CODE:
>>>
>>> Dim oDoc As Word.Document
>>> Dim strVictims As String
>>> Dim rst1 As ADODB.Recordset
>>> Dim i As Integer
>>> i =3D 1
>>> Set rst1 =3D New ADODB.Recordset
>>> rst1.Open "SELECT entryID, fullname, address,
>>> txtphone " _
>>> & "FROM qryVictimNames WHERE entryID =3D " &
>>> Me.txtEntryID, _
>>> CurrentProject.Connection
>>> Do Until rst1.EOF
>>> strVictims =3D strVictims & "#" & i & "-" & rst1!
>>> FullName & " " & rst1!Address & " " & _
>>> rst1!txtphone & Chr(10) 'or vbCR or
>>> everything else I've tried
>>> i =3D i + 1
>>> rst1.MoveNext
>>>
>>> Loop
>>> rst1.Close
>>> Set rst1 =3D Nothing
>>>
>>>
>>> Set oDoc =3D oSupp.Documents.Add
>>> ("Z:\templates\AccessSuppRpt.dot")
>>> With oDoc
>>> .FormFields("victims").Result =3D strVictims
>>> ' Other formfields are populated similarly..
>>> End With
>>> oSupp.Visible =3D True
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>Using Office XP I am populating formfields on a Word
>>>>template from a query in Access. Everything works
>fine,
>>>>but when I attempt to do a line-feed, all I get is a
>>>>little box. I have tried both Chr(10) and Chr(13) for
>>>>line feed and carriage return. Other Chr codes work.
>>> Chr
>>>>(36) produces a dollar sign, etc.
>>>>
>>>>How can I do a line feed in a formfield with code?
>>>>
>>>>Thanks in advance.
>>>>
>>>>Steve
>>>>.
>>>>
>>
>>
>>.
>>=20
>
>
>.
>

Re: Chr(10) does not produce linefeed in formfield by JGM

JGM
Wed Jan 28 11:22:59 CST 2004

Hi Steve,

It is probably because the people at MS decided to include a little comment
in the online help file, somehting to the effect that Chr(11) is not managed
under Microsoft Windows. At least this is what it says in my online help, on
the page that lists the character codes from 0 to 127.

I never used it because I though it was useless to even try, until someone
suggested I gave it a shot a while back... it might have been Lars!

Cheers!

--
_______________________________________
Jean-Guy Marcil
jmarcil@sympatico.ca

"SteveT" <SteveT8@comcast.net> a écrit dans le message de news:
5fb601c3e5c0$78d0d7a0$a401280a@phx.gbl...
Doug--
Thanks for you efforts, I know you spent some time on my
problem. It may have something to do with sending the
code from an MS Access form. Nothing worked until I
tried the vertical tab, Chr(11), as suggested by Lars-
Eric.

Steve
>-----Original Message-----
>Hi Steve,
>
>Not having your database to use, I set up a document
with a couple of
>formfields with one of them having the bookmark name of
victioms and had a
>macro containing the following code run on exit from
that formfield.
>
>Dim i As Long, oDoc As Document
>Set oDoc = ActiveDocument
>For i = 1 To 10
> If oDoc.FormFields("victims").Result = "" Then
> oDoc.FormFields("victims").Result = "Item" & i
> Else
> oDoc.FormFields("victims").Result =
>oDoc.FormFields("victims").Result & vbCr & "Item" & i
> End If
>Next i
>
>It populated the formfield with
>
>Item1¶
>Item2¶
>....
>....
>Item10¶
>
>That was after I corrected the couple of typos in the
code that I had
>suggested (oDoc and odDoc)
>--
>Please post any further questions or followup to the
newsgroups for the
>benefit of others who may be interested. Unsolicited
questions forwarded
>directly to me will only be answered on a paid
consulting basis.
>Hope this helps
>Doug Robbins - Word MVP
>"SteveT" <SteveT8@comcast.net> wrote in message
>news:4c9301c3e4fe$20148e30$a301280a@phx.gbl...
>I just noticed something peculiar, Doug.
>After I populate the Word document, using your code, the
>result with two records is the first string, a small box,
>then the second string--all on one line.
>
>If I put the cursor in front of the small box character
>and hit ENTER, the second string moves down TWO lines and
>the little box disappears.
>
>In other words, the line feed is there, it just doesn't
>activate. When I place another one in manually, the
>first one activates as well.
>
>On a whim I formatted the field to calculate on exit, but
>that didn't help.
>
>I think we're dealing with a bug.
>
>What do you think?
>
>Steve
>>-----Original Message-----
>>Hi Steve,
>>
>>I am sure that it is not because of your trying to
>insert it into a
>>formfield because if a macro containing the following
>code is run on exit
>>from the formfield "Text1", the result is
>>
>>lineone¶
>>linetwo
>>
>>Instead of trying to build a string containing all of
>the records, you may
>>need to create the document and populate the formfield
>by using
>>
>>
>>Do Until rst1.EOF
>> If oDoc.FormFields("victims").Result = "" then
>> odDoc.FormFields("victims").Result = strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> Else
>> odDoc.FormFields("victims").Result =
>>odDoc.FormFields("victims").Result & vbCr &strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> End If
>> i = i + 1
>> rst1.MoveNext
>>Loop
>>
>>
>>--
>>Please post any further questions or followup to the
>newsgroups for the
>>benefit of others who may be interested. Unsolicited
>questions forwarded
>>directly to me will only be answered on a paid
>consulting basis.
>>Hope this helps
>>Doug Robbins - Word MVP
>>"SteveT" <SteveT8@comcast.net> wrote in message
>>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>>> Thanks, Doug, but that didn't work either.
>>> I'm thinking the problem is that I'm in a form field.
>>>
>>> This is the code I'm using to open a Word template and
>>> automatically populate a form field with information
in
>>> an Access recordset. The recordset is a list of
>>> victims's names, addresses, and phone numbers. I want
>to
>>> loop throught the records, giving a number to each
>>> victim. Usually there's no more than 2 or 3, but I
want
>>> them on separate lines. This information populates a
>>> form field called "Victims" in the Word document.
>>> CODE:
>>>
>>> Dim oDoc As Word.Document
>>> Dim strVictims As String
>>> Dim rst1 As ADODB.Recordset
>>> Dim i As Integer
>>> i = 1
>>> Set rst1 = New ADODB.Recordset
>>> rst1.Open "SELECT entryID, fullname, address,
>>> txtphone " _
>>> & "FROM qryVictimNames WHERE entryID = " &
>>> Me.txtEntryID, _
>>> CurrentProject.Connection
>>> Do Until rst1.EOF
>>> strVictims = strVictims & "#" & i & "-" & rst1!
>>> FullName & " " & rst1!Address & " " & _
>>> rst1!txtphone & Chr(10) 'or vbCR or
>>> everything else I've tried
>>> i = i + 1
>>> rst1.MoveNext
>>>
>>> Loop
>>> rst1.Close
>>> Set rst1 = Nothing
>>>
>>>
>>> Set oDoc = oSupp.Documents.Add
>>> ("Z:\templates\AccessSuppRpt.dot")
>>> With oDoc
>>> .FormFields("victims").Result = strVictims
>>> ' Other formfields are populated similarly..
>>> End With
>>> oSupp.Visible = True
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>Using Office XP I am populating formfields on a Word
>>>>template from a query in Access. Everything works
>fine,
>>>>but when I attempt to do a line-feed, all I get is a
>>>>little box. I have tried both Chr(10) and Chr(13) for
>>>>line feed and carriage return. Other Chr codes work.
>>> Chr
>>>>(36) produces a dollar sign, etc.
>>>>
>>>>How can I do a line feed in a formfield with code?
>>>>
>>>>Thanks in advance.
>>>>
>>>>Steve
>>>>.
>>>>
>>
>>
>>.
>>
>
>
>.
>



Re: Chr(10) does not produce linefeed in formfield by Lars-Eric

Lars-Eric
Wed Jan 28 13:00:28 CST 2004

Steve,

>I owe you a beer!

Just tell when and where! :)
If you are going to Redmond for the IW Bridge lab in the end of next month
it will be ok for me.

--
Regards,
Lars-Eric Gisslén


"SteveT" <SteveT8@comcast.net> skrev i meddelandet
news:5cd501c3e5be$db4895a0$a001280a@phx.gbl...
Lars-Eric, You are my hero. I've never heard of a
vertical tab before, but it works.

I owe you a beer!

Steve
>-----Original Message-----
>Steve,
>
>Use Chr(11)
>
>--
>Regards,
>Lars-Eric Gisslén
>
>"SteveT" <SteveT8@comcast.net> skrev i meddelandet
>news:4dab01c3e4fa$d05368b0$a101280a@phx.gbl...
>Thanks, Doug, for your suggested code. It was a
>different way of doing this, but produced the same
>results. With two victims in my data base, your
>suggested code put them both on the same line.
>
>In frustration,
>Steve
>
>>-----Original Message-----
>>Hi Steve,
>>
>>I am sure that it is not because of your trying to
>insert it into a
>>formfield because if a macro containing the following
>code is run on exit
>>from the formfield "Text1", the result is
>>
>>lineone¶
>>linetwo
>>
>>Instead of trying to build a string containing all of
>the records, you may
>>need to create the document and populate the formfield
>by using
>>
>>
>>Do Until rst1.EOF
>> If oDoc.FormFields("victims").Result = "" then
>> odDoc.FormFields("victims").Result = strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> Else
>> odDoc.FormFields("victims").Result =
>>odDoc.FormFields("victims").Result & vbCr &strVictims
>& "#" & i & "-" &
>>rst1!FullName & " " & rst1!Address & " " & rst1!
txtphone
>> End If
>> i = i + 1
>> rst1.MoveNext
>>Loop
>>
>>
>>--
>>Please post any further questions or followup to the
>newsgroups for the
>>benefit of others who may be interested. Unsolicited
>questions forwarded
>>directly to me will only be answered on a paid
>consulting basis.
>>Hope this helps
>>Doug Robbins - Word MVP
>>"SteveT" <SteveT8@comcast.net> wrote in message
>>news:4dd701c3e453$d8667e40$a601280a@phx.gbl...
>>> Thanks, Doug, but that didn't work either.
>>> I'm thinking the problem is that I'm in a form field.
>>>
>>> This is the code I'm using to open a Word template and
>>> automatically populate a form field with information
in
>>> an Access recordset. The recordset is a list of
>>> victims's names, addresses, and phone numbers. I want
>to
>>> loop throught the records, giving a number to each
>>> victim. Usually there's no more than 2 or 3, but I
want
>>> them on separate lines. This information populates a
>>> form field called "Victims" in the Word document.
>>> CODE:
>>>
>>> Dim oDoc As Word.Document
>>> Dim strVictims As String
>>> Dim rst1 As ADODB.Recordset
>>> Dim i As Integer
>>> i = 1
>>> Set rst1 = New ADODB.Recordset
>>> rst1.Open "SELECT entryID, fullname, address,
>>> txtphone " _
>>> & "FROM qryVictimNames WHERE entryID = " &
>>> Me.txtEntryID, _
>>> CurrentProject.Connection
>>> Do Until rst1.EOF
>>> strVictims = strVictims & "#" & i & "-" & rst1!
>>> FullName & " " & rst1!Address & " " & _
>>> rst1!txtphone & Chr(10) 'or vbCR or
>>> everything else I've tried
>>> i = i + 1
>>> rst1.MoveNext
>>>
>>> Loop
>>> rst1.Close
>>> Set rst1 = Nothing
>>>
>>>
>>> Set oDoc = oSupp.Documents.Add
>>> ("Z:\templates\AccessSuppRpt.dot")
>>> With oDoc
>>> .FormFields("victims").Result = strVictims
>>> ' Other formfields are populated similarly..
>>> End With
>>> oSupp.Visible = True
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>Using Office XP I am populating formfields on a Word
>>>>template from a query in Access. Everything works
>fine,
>>>>but when I attempt to do a line-feed, all I get is a
>>>>little box. I have tried both Chr(10) and Chr(13) for
>>>>line feed and carriage return. Other Chr codes work.
>>> Chr
>>>>(36) produces a dollar sign, etc.
>>>>
>>>>How can I do a line feed in a formfield with code?
>>>>
>>>>Thanks in advance.
>>>>
>>>>Steve
>>>>.
>>>>
>>
>>
>>.
>>
>
>
>.
>