Microsoft KB Archive/130405

{| = How to Insert a Date into a Memo Field =
 * width="100%"|

ID: Q130405

The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.6a

SUMMARY
This article shows by example how to insert the current date into a memo field.

Step-by-Step Example
1. Create or use a database that contains a memo field.

2. Create a test screen, and include the memo field.

3. In the screen layout code, give the screen a name such as Test.

4. In the setup code of the screen, type this code:

ON KEY LABEL F12 DO INS.PRG SCATTER MEMVAR MEMO

NOTE: You can choose the function key and Program name. 5. In the WHEN clause of the memo field add the following, replacing  with the name of your memo field:

MODIFY MEMO 6. Create a program named INS.PRG that contains the following code: SET REFRESH TO 1 =INSMODE(.T.) KEYBOARD DTOC(DATE) SHOW WINDOW test REFRESH SAME SET REFRESH TO 0 Any time the screen is run and the F12 key is pressed the program executes and the system date is inserted into the memo field. Additional reference words: FoxWin 2.60a KBCategory: kbprg kbcode KBSubcategory: FxprgGeneral
 * }