Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding data to a memo field - Last entry showing first 1

Status
Not open for further replies.

Steve-vfp9user

Programmer
Feb 5, 2013
337
GB
Hi

I use the following to add entries to a memo field in a table:

Code:
REPLACE MYNOTES WITH LEFT(TIME(),5)+" - "+DTOC(DATE())+": "This is an entry"+CHR(13) ADDITIVE

This is ok however is it possible to show the newest at the top when the memo field is displayed instead of the entries being added and shown last.

An example of what I mean is, currently when adding an entry the lines would show something like:

Code:
12:45 - 08/06/2015: "This is an entry in my memo field"
12:48 - 08/06/2015: "This is an entry in my memo field"
12:51 - 08/06/2015: "This is an entry in my memo field"

Whereas I would like it to show as:

Code:
12:51 - 08/06/2015: "This is an entry in my memo field"
12:48 - 08/06/2015: "This is an entry in my memo field"
12:45 - 08/06/2015: "This is an entry in my memo field"

So basically I want the last entry at the top of the list.

Is this possible?

Thank you

Steve
 
Hi Steve,

One option would be to omit the ADDITIVE clause, and to explicitly add in the existing memo field each time:

[tt]REPLACE MYNOTES WITH LEFT(TIME(),5)+" - "+DTOC(DATE())+": "This is an entry"+CHR(13) + MyNotes[/tt]

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top