Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.paradox    |    To crash or not to crash, asks Borland    |    9,834 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 8,422 of 9,834    |
|    Jim Hargan to Kenneth    |
|    Re: Unlocking problem...    |
|    04 Apr 07 22:32:23    |
   
   From: noJimspam@omitThisHarganonline.com   
      
   On Wed, 04 Apr 2007 10:30:17 -0400, Kenneth wrote:   
      
   > Howdy,   
   >   
   > Originally, I had code on a form to enter today() in a field   
   > called ModDate when something in the underlying tables was   
   > modified using the form. That code looked like this, and   
   > worked fine:   
   >   
   > ;// This code executes only for the form:   
   >   
   > if eventInfo.id() = DataPostRecord or   
   > (eventInfo.id() = DataUnlockRecord and   
   > active.RecordStatus("Modified"))   
   > then    
   > ModDate.value = today()   
   > endIf   
      
   I am curious. Why not just put the code in the record's canDepart method?   
   Then all you need is   
   if not isEdit()   
    then   
    edit()   
    ModDate'value = today()   
    endedit()   
    else   
    ModDate'value = today()   
   endif   
      
   This won't fire until you leave the first record. If you open the form and   
   then close it, the first record will record the date this happened during   
   the close, not during the open.   
      
   Off hand, I don't see how this could possibly cause conflicts with other   
   actions within the form.   
      
      
   Jim Hargan   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca