473,588 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Display Memo Text

I have a dataItem that is a text memo field. When I use
<%#container.Da taItem('memoTex t')%>, it displays it with no line breaks.

Is there a function to convert the line breaks on the memo field?

Thanks,
George
Nov 18 '05 #1
2 3437
You'll need to replace line breaks: &vbcrlf
With line break tag <br>

And vice versa when putting the data into a textarea for editing.

Simon.

"Gmansky" <gm*****@starmd .net> wrote in message
news:eO******** ******@TK2MSFTN GP11.phx.gbl...
I have a dataItem that is a text memo field. When I use
<%#container.Da taItem('memoTex t')%>, it displays it with no line breaks.

Is there a function to convert the line breaks on the memo field?

Thanks,
George

Nov 18 '05 #2
Hi George,

When you display this in a textbox it should display fine. If you use a label you need to convert the line breaks with <br> or <p> tags. Here's a routine that I use for this:
/// <summary>
/// Fixes a plain text field for display as HTML by replacing carriage returns
/// with the appropriate br and p tags for breaks.
/// </summary>
/// <param name="String Text">Input string</param>
/// <returns>Fixe d up string</returns>
public static string DisplayMemo(str ing HtmlText)
{
HtmlText = HtmlText.Replac e("\r\n","\r" );
HtmlText = HtmlText.Replac e("\n","\r");
HtmlText = HtmlText.Replac e("\r\r","<p>") ;
HtmlText = HtmlText.Replac e("\r","<br>" );
return HtmlText;
}
+++ Rick --
--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web

"Gmansky" <gm*****@starmd .net> wrote in message news:eO******** ******@TK2MSFTN GP11.phx.gbl...
I have a dataItem that is a text memo field. When I use
<%#container.Da taItem('memoTex t')%>, it displays it with no line breaks.

Is there a function to convert the line breaks on the memo field?

Thanks,
George

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8657
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo field in plain text. That's because I truncate the string text but if, when I truncate it there's a rich tag the code following the truncated string is corrupted. Don't know if it's clear enough.
6
10446
by: Shyguy | last post by:
I want to create two buttons on a form. One would allow the user to Copy the contents of the current records memo field, the other would allow them to print. I set up a report based on the memo field, and it works. But, it seems wrong since I had to create a huge text box to accommodate memo fields with a lot of text. Thanks for any help, ShyGuy
1
261
by: Gmansky | last post by:
I have a dataItem that is a text memo field. When I use <%#container.DataItem('memoText')%>, it displays it with no line breaks. Is there a function to convert the line breaks on the memo field? Thanks, George
6
2690
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 a simple INSERT INTO sql command. Anyone know a way around this? Sample strSQL = "INSERT INTO tblListings " & _ "(Dir, Street, City, State, " & _ "AFirst, Price, ALast, MainPhoto, Summary, Details,
0
377
by: Ennio-Sr | last post by:
Hi all! After a very long struggle I finally succeded in transferring my old *.dbf file and the relating *.dbt (alias memo fields) to a pg table. For the time being I put the memo field in a separate table having two fields only (i.e.: n_memo integer, memo text) which can be related to the main table in a view.
0
866
by: Stephen E. Weber | last post by:
I have a series of HTM files, I want to dynamically display these on the screen, in the active window as part of an information screen which will have additional objects, what is a good way to do this, I could read into an access memo and display that way, is there a better method which I can use the HTM files themselves without reading into access memo field. I could change the format of this files from HTM to DOC or Rich Text or just...
4
7233
by: Mark Reed | last post by:
Hi All, here is what I am trying to achieve. I have a memo field on a form which users will need to add to as and when. I do not want them to be able to edit information which already exists within this field. My idea was to have the memo field locked on the form to stop edits. Place a command button by the memo field which opens an unbound form with a single text box. The user enters their update into the unbound form and upon closing...
9
5725
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo field is printed within the detailed area. The problem is, the apllication is not setup properly, thus the users are entering data within the memo field as: location1 1/1/2005 1/1/2006
0
1436
by: Kassimu | last post by:
Hi guys out there, There is this database Iam creating, I have a table with 40 fields among which there are Date/time, Text, Number, Memo and Yes/No fields and I have created the form bound to that tabe. I have also created Unbound form (for searching purpose) which is similar in layout with the bound one; in this search form the user will fill-in the keywords in as many text boxes as he wish to narrow down the search. The search results are...
0
7862
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7987
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6634
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3847
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2372
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1459
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1196
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.