A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Condensing Text fields into a Memo field - Need to retain line spa



 
 
Thread Tools Display Modes
  #1  
Old December 27th, 2004, 10:25 PM
Doc Don Sturgiss
external usenet poster
 
Posts: n/a
Default Condensing Text fields into a Memo field - Need to retain line spa

I have eight lines of text, one after another, which I need to insert into a
Memo field. The first line always has content. The other liines may not, and
some may have content in one of more lines, skip one of more lines and then
have more content.

I need to have the contents of the Memo field look just like the original
Text field lines, which may have either nothing in the line, a short line, or
a long line (to the end of the field).

Thus if the first line is long, the second line short, the third line long,
the fourth and fifth lines blank and the sixth line long, I will get the
display from the Memo field to dupllicate that.

The problem I am having is that I don't know how to insert a line-feed after
appending the data from each line which would give me the desired result.

Manually, I would (in the case above) just enter the long first line, let
the text wrap automatically to make the short second line, hit Enter to go
to the third line and enter it, hit Enter three times to finsh that third
line and skip the fourth and fifth lines, and then enter the sixth line and
then hit Tab to leave the field. That would give me the same appearance as
was there in the eight separate text lines from before.
--
"Doc" Don Sturgiss, the Computer Doctor
  #2  
Old December 27th, 2004, 10:55 PM
Doc Don Sturgiss
external usenet poster
 
Posts: n/a
Default

I forgot to mention that this is for client's Access '97 database, being
converted to a new format, so "vbcrlf" command I have seen used in this forum
does not work (see "Memo field update", third Stewart Tanner reply.

Also, I am using an update query to take the contents of tthe individual
description lines (fields) and appending them to the Description memo field.
That doesn't work.

I don't want to have to resort to ending each line with "-= end of liine
=-" and then letting the user fix it manually as they come across it.

""Doc" Don Sturgiss" wrote:

I have eight lines of text, one after another, which I need to insert into a
Memo field. The first line always has content. The other liines may not, and
some may have content in one of more lines, skip one of more lines and then
have more content.

I need to have the contents of the Memo field look just like the original
Text field lines, which may have either nothing in the line, a short line, or
a long line (to the end of the field).

Thus if the first line is long, the second line short, the third line long,
the fourth and fifth lines blank and the sixth line long, I will get the
display from the Memo field to dupllicate that.

The problem I am having is that I don't know how to insert a line-feed after
appending the data from each line which would give me the desired result.

Manually, I would (in the case above) just enter the long first line, let
the text wrap automatically to make the short second line, hit Enter to go
to the third line and enter it, hit Enter three times to finsh that third
line and skip the fourth and fifth lines, and then enter the sixth line and
then hit Tab to leave the field. That would give me the same appearance as
was there in the eight separate text lines from before.
--
"Doc" Don Sturgiss, the Computer Doctor

  #3  
Old December 28th, 2004, 12:44 AM
Brendan Reynolds
external usenet poster
 
Posts: n/a
Default

vbCrLf works fine in Access 97, but it only works in code. If you're doing
this in a query, use Chr$(13) & Chr$(10). For example ...

UPDATE TargetTable SET TargetField = SourceField1 & Chr$(13) & Chr$(10) &
SourceField2 & Chr$(13) & Chr$(10) & SourceField3

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


""Doc" Don Sturgiss" wrote in
message ...
I forgot to mention that this is for client's Access '97 database, being
converted to a new format, so "vbcrlf" command I have seen used in this
forum
does not work (see "Memo field update", third Stewart Tanner reply.

Also, I am using an update query to take the contents of tthe individual
description lines (fields) and appending them to the Description memo
field.
That doesn't work.

I don't want to have to resort to ending each line with "-= end of liine
=-" and then letting the user fix it manually as they come across it.

""Doc" Don Sturgiss" wrote:

I have eight lines of text, one after another, which I need to insert
into a
Memo field. The first line always has content. The other liines may not,
and
some may have content in one of more lines, skip one of more lines and
then
have more content.

I need to have the contents of the Memo field look just like the original
Text field lines, which may have either nothing in the line, a short
line, or
a long line (to the end of the field).

Thus if the first line is long, the second line short, the third line
long,
the fourth and fifth lines blank and the sixth line long, I will get the
display from the Memo field to dupllicate that.

The problem I am having is that I don't know how to insert a line-feed
after
appending the data from each line which would give me the desired result.

Manually, I would (in the case above) just enter the long first line, let
the text wrap automatically to make the short second line, hit Enter to
go
to the third line and enter it, hit Enter three times to finsh that
third
line and skip the fourth and fifth lines, and then enter the sixth line
and
then hit Tab to leave the field. That would give me the same appearance
as
was there in the eight separate text lines from before.
--
"Doc" Don Sturgiss, the Computer Doctor



  #4  
Old December 28th, 2004, 02:43 AM
Doc Don Sturgiss
external usenet poster
 
Posts: n/a
Default

Deaar Brendan,

I had laready tried the "& CHR#(13) & CHR$(10)" to attempt to get a CR-LF
but that didn't work . What did finally turn out to work is a double CR-LF.
The first one jsut acts like a trigger (i.e. "Get ready for a CR-LF") The
second actually gives a linefeed. Of course, this means that thee endo fo
each blank line is a CR-LF CR-LF. And two blank lines double this, for four
CR-LFs in a row.

Since the first CR-LF acts as a "shifter", the next three CR-LFs act as real
CR-LFs and each gives an add'l linefeed. So multiple empty lines between
lines with data in them give more than one add'l linefeed for each empty
line, specfically, two empty lines give three linefeeds, three empties give
five linefeeds, etc. Who'd a thought?

And if a CR-LF is placed at the end of every non-empty line, each line
breaks at its end, where it is supposed to.

"Brendan Reynolds" wrote:

vbCrLf works fine in Access 97, but it only works in code. If you're doing
this in a query, use Chr$(13) & Chr$(10). For example ...

UPDATE TargetTable SET TargetField = SourceField1 & Chr$(13) & Chr$(10) &
SourceField2 & Chr$(13) & Chr$(10) & SourceField3

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


""Doc" Don Sturgiss" wrote in
message ...
I forgot to mention that this is for client's Access '97 database, being
converted to a new format, so "vbcrlf" command I have seen used in this
forum
does not work (see "Memo field update", third Stewart Tanner reply.

Also, I am using an update query to take the contents of tthe individual
description lines (fields) and appending them to the Description memo
field.
That doesn't work.

I don't want to have to resort to ending each line with "-= end of liine
=-" and then letting the user fix it manually as they come across it.

""Doc" Don Sturgiss" wrote:

I have eight lines of text, one after another, which I need to insert
into a
Memo field. The first line always has content. The other liines may not,
and
some may have content in one of more lines, skip one of more lines and
then
have more content.

I need to have the contents of the Memo field look just like the original
Text field lines, which may have either nothing in the line, a short
line, or
a long line (to the end of the field).

Thus if the first line is long, the second line short, the third line
long,
the fourth and fifth lines blank and the sixth line long, I will get the
display from the Memo field to dupllicate that.

The problem I am having is that I don't know how to insert a line-feed
after
appending the data from each line which would give me the desired result.

Manually, I would (in the case above) just enter the long first line, let
the text wrap automatically to make the short second line, hit Enter to
go
to the third line and enter it, hit Enter three times to finsh that
third
line and skip the fourth and fifth lines, and then enter the sixth line
and
then hit Tab to leave the field. That would give me the same appearance
as
was there in the eight separate text lines from before.
--
"Doc" Don Sturgiss, the Computer Doctor




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sort records by size of items in memo field, or pull those > 255 s PitBullBlonde Running & Setting Up Queries 1 September 22nd, 2004 09:31 PM
Text field Or Memo Field Terry General Discussion 2 August 5th, 2004 04:32 AM
Memo Field data truncated in query Joel Running & Setting Up Queries 3 August 4th, 2004 03:40 PM
combining date and text fields into text field Kennedy Running & Setting Up Queries 2 August 2nd, 2004 11:42 AM
Memo field gets truncated in report M Skabialka Setting Up & Running Reports 5 June 25th, 2004 04:56 PM


All times are GMT +1. The time now is 02:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.