Re: printable size of memo field
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Tue, 7 Feb 2006 16:29:02 -0500
You either have to put the NEWEST items on top instead of at the bottom or
do as I suggested and add a table to hold this information. The table might
be something like:
ActionDate - date field
ActionType - Text field (Serviced, Repaired, Callout)
Details (althought this looks as if it could be multiple fields - Name of
engineer, action taken, etc)
If you have all the data in one memo field as you do now, there is nothing
that I know that you can do to select the most recent items and print them
only unless you use some vba code to split the data out into multiple lines
and then select the latest.
Assumptions:
Each piece of data has a carriage return line feed
You are using Access 2000 or later.
Add the following code to a module and then call it in your query. DO NOT
name the module the same as the function or you will get an error.
Field: JustTheLatest: getTheLatest([YourMemoField],12)
Public Function getTheLatest(txtIN, Optional iLines As Integer = 6) As
String
Dim strOut As String, iLoop As Integer
Dim iStart As Integer, iEnd As Integer
Dim strArray As Variant
If Len(txtIN & vbNullString) = 0 Then
getTheLatest = vbNullString
Else
strArray = Split(txtIN, Chr(13) & Chr(10), -1, vbTextCompare)
iEnd = UBound(strArray)
iStart = iEnd - iLines + 1
If iStart < LBound(strArray) Then iStart = LBound(strArray)
For iLoop = iStart To iEnd
strOut = strOut & strArray(iLoop) & Chr(13) & Chr(10)
Next iLoop
getTheLatest = strOut
End If
End Function
"Roger" <roger@xxxxxxxxxxxxxxxx> wrote in message
news:1139345770.208279.33480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
John
I enter the data by copy typing from the engineers report like this:
05/02/06 Serviced/3658/256214 Dave - {6957425/125 repair BGU's}
06/02/06 Repair/3568/365895 Roger - {695874/001 supply only}
06/02/06 Callout/2556/789456 Phil - {695365/005 water leak}
It is a field that is only used as a reference to see a history of the
site.
The numbers are document and job number references which are used to
file the scanned copies of the original engineer sheets.
The problem I have is: a window is shown on the database which expands
when printed to include all of the entries made.
I would like to retain the window at the original size but only print
out the latest 12 entries whilst keeping all of the history within the
database. I can achieve the result I want by making the 'Can grow' to
'no' but it prints out the oldest entries not the newest.
Can you help?
.
- Follow-Ups:
- Re: printable size of memo field
- From: Roger
- Re: printable size of memo field
- References:
- printable size of memo field
- From: Roger
- Re: printable size of memo field
- From: John Spencer
- Re: printable size of memo field
- From: Roger
- printable size of memo field
- Prev by Date: Re: How to have access generate a username and password?
- Next by Date: Re: Problem in Access mail merge
- Previous by thread: Re: printable size of memo field
- Next by thread: Re: printable size of memo field
- Index(es):