472,973 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,973 software developers and data experts.

Access memo field - maintaining line breaks and indents

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
5 4197
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
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
3,406 Expert 2GB
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
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
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

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

Similar topics

2
by: Jim Plante | last post by:
I have a memo field in a MS Access table. The contents of the field may look like this: 1. This is number one 2. This is number 2 3. Skipping lines is fun if your #3 But when I write it...
3
by: Hugh Welford | last post by:
Hi ... My application saves variable length user-generated messages in an ACCESS memo field. ASP writes these messages correctly retaining CR LF to generate new paragraphs. (have checked this in...
1
by: Rich | last post by:
Ok I am trying to read a memo field from an Access DB that has more than 255 char. I am only getting 255 chars back from the reader. Why is this and how do i get the whole memo field. Here is a...
2
by: Vincent Lau | last post by:
Hello, I'm new on ASP and Access. I stored several lines of information in a Access memo field. I use follow ASP response.write statement to display contain of the memo field. Response.Write...
0
by: Scott Van | last post by:
Hello- I am trying to create an Access table using DDL that has a memo field. I have the syntax to create the memo field but I can't find the syntax to also set whether the memo field should...
6
by: Matt | last post by:
I'm having difficulty with trying to update a Access memo field through an SQL statement where the value I'm trying to pass is longer than 255 characters. The field is being truncated. I'm using...
3
by: M. Noroozi Eghbali | last post by:
Hi All, I used the below code to get the information from a MS Access database file: ---------------------------------------------------- bdpConnection1.Open();...
1
by: Arielle | last post by:
Trying to migrate from ASP classic to ColdFusion and was wondering how to handle this. A form has a text area that submits to a database and stores a memo that can later be viewed. How can I...
3
by: Kassimu | last post by:
I need to update the memo field in the access table. I have unbound form frmNewEntry with two text boxes , and one command button cmdSave. Usually the user opens the frmNewEntry to add new...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.