Re: Memo Field

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

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: Hi Jay,Hm, i think, the 255 character limit of foxpro has nothing to do with
    ... While you can avoid the string literal problem, you don't need a memo field and it doesn't actually do anything in this example. ... SqlExec(conn_handle, m.sql_str, 'cursorname') ... also, i would think that mysql also will use standard sql parameters in queries, although i cannot recall if i ever done so myself. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Reading TXT file into MSAccess using Line Input?
    ... table with a memo field, then I parse out the memo field into respective ... Dim L1 As string, i As Long, j As Long, k As Long ... Dim bEnd As Boolean, str1 As string ...
    (comp.databases.ms-access)
  • 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: Not In (SELECT DISTINCTROW
    ... I tried your query, but it is not working, cs-user-agent is a memo field, so ... I has to be a memo field as the data I ... Public Function IsExcludedAs Boolean ... Dim rs As DAO.Recordset ...
    (microsoft.public.access.queries)