importing formatted text to Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to import formatted text I have in an MS Word Table to Access and
want to keep the formatting; when I try to move it via Excel it either looses
all the paragraphing or changes them to ‘squares’. I’ve used the online KB
to find some code to use an Access Query to change the ‘squares’ to <CR> but
it won’t do it, any suggestions, Thanks Adrian
 
Hi Adrian,

Access textboxes can't display formatted text. Even tab characters
aren't recognised.

The problem with the "squares" when you import via Excel is that Excel
uses <LF> for line breaks, while Access requires <CR><LF> (and to keep
things simple, Word uses <CR> for paragraph marks). After importing, use
the Replace() function in an update query, e.g. update field XXX to

Replace([XXX], Chr(10), Chr(13)& Chr(10))

That will work in all versions from Access 2000 onwards (though in
Access 2000 it requires that up to date service packs are installed).

Another approach is to save the Word document as HTML and import from
that.
 
Back
Top