By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,369 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,369 IT Pros & Developers. It's quick & easy.

Access memo field - maintaining line breaks and indents

P: 6
I have spent several days on this. I hope someone can help me. I am using Acccess 2000. I have a memo field where I have cut and pasted bulleted/numbered lists from Microsoft Word. I want to display this information via asp. I have managed to get the numbers, bullets, and even skipped lines to show up by using the Replace function and vblfcr. I cannot for the life of me find out how to retain the indents. All the lines show up far to the left and do not maintain the indent, so the nicely formatted "outline" is lost and it is difficult to read.

Am I trying to do something that simply goes against the grain?

I would really appreciate help or an explanation on why this simply won't work. Is the problem when I paste into the memo field in Access or in getting the data from the field or both?
Jul 29 '07 #1
Share this Question
Share on Google+
5 Replies


P: 1
Try Replace(Memo-field,vbCrLf,"<br>") , this should work. Plenty information to find on the net for this problem

I have spent several days on this. I hope someone can help me. I am using Acccess 2000. I have a memo field where I have cut and pasted bulleted/numbered lists from Microsoft Word. I want to display this information via asp. I have managed to get the numbers, bullets, and even skipped lines to show up by using the Replace function and vblfcr. I cannot for the life of me find out how to retain the indents. All the lines show up far to the left and do not maintain the indent, so the nicely formatted "outline" is lost and it is difficult to read.

Am I trying to do something that simply goes against the grain?

I would really appreciate help or an explanation on why this simply won't work. Is the problem when I paste into the memo field in Access or in getting the data from the field or both?
Jul 30 '07 #2

P: 6
Actually that's what I have in place now. I apologize for not putting that in my original post. That does a fine job of taking care of line breaks. My problem is as follows for lists as below:

  1. Item one
  2. Item two
  • part a
  • part b
When I cut and paste this into the memo field and via asp I get the following:
  1. Item one
  2. Item two
  • part a
  • part b

How do I retain the indent?
Jul 30 '07 #3

jhardman
Expert 2.5K+
P: 3,405
Actually that's what I have in place now. I apologize for not putting that in my original post. That does a fine job of taking care of line breaks. My problem is as follows for lists as below:

  1. Item one
  2. Item two
  • part a
  • part b
When I cut and paste this into the memo field and via asp I get the following:
  1. Item one
  2. Item two
  • part a
  • part b

How do I retain the indent?
This is actually an HTML problem, All browsers ignore all white space unless you specify otherwise. What you want is something like this HTML output:[html]<ul><li>item 1</li>
<li>item 2</li>
<ul><li>part A</li>
<li>part B</li></ul>
<li>item 3</li></ul>[/html] Notice the indented list is within the first list. I don't know of anyway to do this automatically, it will take a great deal of "replace"-ing to do it correctly. You might otherwise be able to fudge something that looks right with indents and forced white space, but that always makes HTML purists groan.

Jared
Aug 1 '07 #4

P: 6
This is actually an HTML problem, All browsers ignore all white space unless you specify otherwise. What you want is something like this HTML output:[html]<ul><li>item 1</li>
<li>item 2</li>
<ul><li>part A</li>
<li>part B</li></ul>
<li>item 3</li></ul>[/html] Notice the indented list is within the first list. I don't know of anyway to do this automatically, it will take a great deal of "replace"-ing to do it correctly. You might otherwise be able to fudge something that looks right with indents and forced white space, but that always makes HTML purists groan.

Jared
Thanks for the explanation...I will stop beating my head against the wall on that one.
Aug 5 '07 #5

P: n/a
Try This This works -
tmpstr is a variable

tmpstr = replace(RecSet("memofiled"),vbcrlf,"<br>")
tmpstr = replace(tmpstr," ","&nbsp;")


then

response.write "<p>" tmpstr "</p>"

your data will be printed with carriage return and white space i.e indenting.

hope this helps - d. a. s. d. i. d. e. e. n . c. o. m
Oct 20 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.