home *** CD-ROM | disk | FTP | other *** search
/ DOS Wares / doswares.zip / doswares / DATABASE / DBASE5 / CUA_SAMP.ZIP / UPDETAIL.PRG < prev    next >
Encoding:
Text File  |  1994-06-24  |  1.2 KB  |  45 lines

  1. PROCEDURE UpDetail
  2. PARAMETERS poForm
  3. *----------------------------------------------------------------------------
  4. * NAME
  5. *   UpDetail - Update the SET KEY TO after a change in the master record
  6. *
  7. * PARAMETERS
  8. *   poForm     = oRef to Form
  9. *
  10. *----------------------------------------------------------------------------
  11.     *--------------------------------------------------------------
  12.     *-- Assume for now that the link is on the master's primary key
  13.     *--------------------------------------------------------------
  14.     SELECT (poForm.CurrMast)
  15.  
  16.     *---------------------------------------------------
  17.     *-- Loop thru detail regions and reset the key range
  18.     *---------------------------------------------------
  19.     oFirst = Form.FileList
  20.     oFirst = oFirst.First
  21.     oCurrent = oFirst
  22.     DO WHILE .T.
  23.  
  24.         IF TYPE( "oCurrent.StatusMessage" ) = "C" .AND. ;
  25.            LEFT( oCurrent.StatusMessage, 6 ) = [Detail]
  26.             SELECT (oCurrent.FileAlias)
  27.             SET KEY TO EVAL( oCurrent.MastKeyFld )
  28.             GO TOP
  29.         ENDIF
  30.  
  31.         oCurrent = oCurrent.After
  32.         IF oCurrent = oFirst
  33.             EXIT
  34.         ENDIF
  35.     ENDDO
  36.  
  37.     SELECT (poForm.CurrMast)
  38.  
  39. RETURN
  40. *-- EOP: UpDetail WITH poForm
  41.  
  42.  
  43.  
  44.  
  45.