Format String in Table Cell

P

Peter Hibbs

Using Access 2003 and Word 2003.

I am using Automation to create a Word document from with an Access
database. In the database I have a multi-line Text box on a form which
the user types in an address which may take 4 or 5 lines of text. I
have created a query which holds the contents of the various fields
and I am then copying the output from the query to a Word document.

Access uses Chr(13) + Chr(10) at the end of each line and Word (I
believe) uses just Chr(13). So in the query I am changing the codes in
this field from one to the other like so :-

CAD: Replace([ClientAddress],Chr(13) & Chr(10),Chr(13))

(CAD is the alias field name I am using and ClientAddress is the field
in the table).

This works fine in a normal document, the text displays as -

100 The High Street
Sometown
SomeCounty
Postcode

The problem is that if I place the field in a Word table cell the
Chr(13) code is converted to a small square and the address displays
like this

100 The High Street+Sometown+SomeCounty+Postcode

(where the + characters are actually little squares).

How can I format the string to show correctly in a table cell (and
outside a table, if possible).

TIA

Peter Hibbs.
 
P

Peter Hibbs

OK. I think I have found it :-

CAD: Replace([ClientAddress],Chr(13) & Chr(10),Chr(11))

I have no idea why but this seems to work (so far).

Peter Hibbs.
 

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