Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

Enter "something" every 80 characters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
denise - 14 Nov 2005 16:19 GMT
In a large memo type field, how can I enter something, like a carriage
return, after every 80th character?
Thanks for any help with this.
denise
Pete - 14 Nov 2005 16:50 GMT
I am a little puzzled as to why you would want to to do this as the text in
this field will wrap when bound to a form or a report addn you can use the
Can Grow formatting property on a report.

However, if you want a carriage return in a memo field you can use press
CTRL+ENTER. If you really do need to split the field programmatically then
let me know.
Signature

Peter Schmidt
Ross-on-Wye, UK

> In a large memo type field, how can I enter something, like a carriage
> return, after every 80th character?
> Thanks for any help with this.
> denise
denise - 14 Nov 2005 17:42 GMT
I have an access database with several thousand records in a table. Each
record has a memo field with a report in it. The reports can be very long. I
need to break the reports up into 80 character pieces with something marking
each 80 characters.  We have a vendor who is going to add these to their
product database for us and they have requested the data to be sent to them
this way.  So I could use some help to set this up to run programmatically!  
My programming skills are very rusty. Thanks a lot for your help.

> I am a little puzzled as to why you would want to to do this as the text in
> this field will wrap when bound to a form or a report addn you can use the
[quoted text clipped - 8 lines]
> > Thanks for any help with this.
> > denise
John Spencer - 14 Nov 2005 17:51 GMT
Do you need to keep words in whole chunks or is it simply 80 characters and
you don't care if the break is in the middle of a word?

Short example using "This is a line with several words."

This is a line with sev
eral words.

Or does it need to be

This is a line with
several words.

Also, do you count the inserted character(s) when determining 80 characters.
Not that it will happen but what do you want done if you break on words and
there is no space to trigger the break (such as a long URL address)

>I have an access database with several thousand records in a table. Each
> record has a memo field with a report in it. The reports can be very long.
[quoted text clipped - 23 lines]
>> > Thanks for any help with this.
>> > denise
John Vinson - 14 Nov 2005 21:38 GMT
>In a large memo type field, how can I enter something, like a carriage
>return, after every 80th character?
>Thanks for any help with this.
>denise

You'll need some VBA code to do this. Here's a function (untested, off
the top of my head); you can use it in a Select query as a calculated
field for export, or if you want to actually store the linebreaks, as
the Update To in an update query.

Public Function Linebreak80(ByVal strIn As String) As String
Dim iPos As Integer
Dim strOut As String
strOut = ""
Do Until Len(strIn) < 81
  strOut = Left(strIn, 80) & vbCrLf
  strIn = Mid(strIn, 81)
Loop
Linebreak80 = strOut
End Function

Note that this will break lines AT 80, which may well be in the middl
e of a word. Parsing to truly word-wrap will take more work!

                 John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.