Re: Memo Field

From: Ken Snell [MVP] (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 08/27/04


Date: Fri, 27 Aug 2004 00:35:40 -0400

Put the function in a regular module.

Use a query as the report's or form's RecordSource. In that query, replace
the memo field with a calculated field:

CrLfMemo: InsertCRLFs([NameOfMemoField])

-- 
        Ken Snell
<MS ACCESS MVP>
"Bernie" <anonymous@discussions.microsoft.com> wrote in message
news:10aa01c48bee$d3125d90$a601280a@phx.gbl...
> Forgive me ignorance on this.  Where would I callout the
> code below?
>
> Thanks for the help.
> Bernie
> >-----Original Message-----
> >Likely this can be done by a user-defined function that
> would go through the
> >memo's string value and insert carriage return and line
> feed combinations at
> >various points. Function would need to copy the string
> one character at a
> >time and count commas and then insert the characters.
> Something like this,
> >perhaps, to get you started:
> >
> >
> >Public Function InsertCRLFs(strOriginal As String) As
> String
> >Dim strNew As String, strT as String
> >Dim lngPos As Long
> >Dim intComma As Integer
> >strNew = ""
> >intComma = 0
> >For lngPos = 1 To Len(strOriginal)
> >    strT = Mid(strOriginal, lngPos, 1)
> >    If strT = "," Then intComma = intComma + 1
> >    strNew = strNew & strT
> >    If intComma = 5 Then
> >        strNew = strNew & vbCrLf
> >        intComma = 0
> >    End If
> >Next lngPos
> >InsertCRLFs = strNew
> >End Function
> >
> >-- 
> >
> >        Ken Snell
> ><MS ACCESS MVP>
> >
> >"Bernie" <anonymous@discussions.microsoft.com> wrote in
> message
> >news:105a01c48bdf$3997e400$a501280a@phx.gbl...
> >> Is there a way to force a Return in a memo field?  I
> >> import a memo field that is one long string.
> >> Ex.:
> >> R1, R2, R3, R45, R63-R75,R100-R200,R299...
> >>
> >> When I use the field in a form or report, I have to fix
> a
> >> certain width.  This means the string could be cutoff at
> >> an important break...i.e. R1 with the 00 (100) forced
> onto
> >> the next line.  I would like to force a return after a
> >> fixed number of commas...or something like that.
> >>
> >> Is this possible?
> >> Bernie
> >
> >
> >.
> >


Relevant Pages

  • Re: Whats the character code for the return key?
    ... > whole line in this memo field into it's own text field, ... because you get a different character when you press ... >> Public Function SplitLines(ByVal strInput As String) As Variant ... Dim strOutput As String ...
    (microsoft.public.access.reports)
  • Re: MEMO with vbNewLine Query Help
    ... Once you have the whole memo field stored in a string variable ... Dim dteLastDate As Date ... Dim strCurrentLine As String ... Do 'Start a Loop ...
    (microsoft.public.access.formscoding)
  • Re: Memo Field
    ... Public Function InsertCRLFs(strOriginal As String) As String ... Dim strNew As String, strT as String, strO As String ... Dim lngPos As Long ... >>>>> Is there a way to force a Return in a memo field? ...
    (microsoft.public.access.forms)
  • Re: Create ASCII interface file
    ... I've had luck exporting the memo field as a delimited ascii text file and can ... > DoCmd.TransferText to export the query. ... >>being a fixed length string 508 characters long, the end of which is lot of ...
    (microsoft.public.access.modulesdaovba)
  • Re: Access a specific variable in memory
    ... : KEYBOARD "test string" ... with the search argument set as my original search string, ... If I do a Control+F to search the memo field, ... What I've done is written my substring into the _CLIPBOARD. ...
    (microsoft.public.fox.programmer.exchange)