Re: Memo Field
From: Ken Snell [MVP] (kthsneisllis9_at_ncoomcastt.renaetl)
Date: 08/27/04
- Next message: Kiwi lost in Asia: "Copying form fields into a new record."
- Previous message: Tony Toews: "Re: Access hanging, corrupting, getting me worried"
- In reply to: Bernie: "Re: Memo Field"
- Next in thread: Bernie: "Re: Memo Field"
- Reply: Bernie: "Re: Memo Field"
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
> >.
> >
- Next message: Kiwi lost in Asia: "Copying form fields into a new record."
- Previous message: Tony Toews: "Re: Access hanging, corrupting, getting me worried"
- In reply to: Bernie: "Re: Memo Field"
- Next in thread: Bernie: "Re: Memo Field"
- Reply: Bernie: "Re: Memo Field"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|