Microsoft KB Archive/101018

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 12:24, 21 July 2020 by X010 (talk | contribs) (Text replacement - "&" to "&")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Base


How to Copy Memo or General Fields to New Records

Article ID: 101018

Article Last Modified on 12/1/2003



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft FoxPro 2.5b
  • Microsoft FoxPro 2.5a
  • Microsoft FoxPro 2.0
  • Microsoft FoxPro 2.5b for MS-DOS
  • Microsoft FoxPro 2.5a



This article was previously published under Q101018

According to page C3-723 in the FoxPro 2.0 "Commands & Functions" manual and page L3-886 of the FoxPro 2.5 "Language Reference" manual, SET CARRY ON will "bring all fields from the current record to a new record." This statement is incorrect. SET CARRY ON will not bring forward memo or general fields. (Using SET CARRY TO and specifying the memo or general field also will not bring the memo or general field forward.)

To copy the contents of a memo field to a new record, use the REPLACE command. For example:

   temp = db.memfield
   APPEND BLANK
   REPLACE db.memfield WITH temp
        

NOTE: The following methods require that the system menu bars and appropriate shortcut keys be available for _MED_COPY and _MED_PASTE, and that the menu be active and available (SET SYSMENU ON or SET SYSMENU AUTOMATIC).

To copy a general field, use the following code:

   USE table1
   SELECT 0
   USE table2
   SELECT table1
   SKIP 1
   KEYBOARD "{ctrl+c} {ctrl+w}"
   MODIFY GENERAL table1.genfield
   SELECT table2
   APPEND BLANK
   KEYBOARD "{ctrl+v} {ctrl+w}"
   MODIFY GENERAL table2.genfield
            

To carry all information from all fields, except for general fields, into a new record, use one of the following methods:

Method 1

   SCATTER MEMVAR MEMO
   APPEND BLANK
   GATHER MEMVAR MEMO
        

Method 2

   SET CARRY ON
   BROWSE NOWAIT
   KEYBOARD "{CTRL+N}"
        


Additional query words: VFoxWin FoxDos FoxWin docerr

Keywords: kbcode KB101018