home bbs files messages ]

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,417 of 9,834   
   Kenneth to jmose@mapson.attglobal.net   
   Re: Unlocking problem...   
   04 Apr 07 11:52:13   
   
   From: usenet@soleSPAMLESSassociates.com   
      
   On 4 Apr 2007 11:19:17 -0400, "Jim Moseley"   
    wrote:   
      
   >   
   >Kenneth,   
   >   
   >But that probably won't solve your problem. ;)   
   >   
   >I'm guessing all of your code is in the Action() method at the form level.   
   > The error occurs because it is trying to handle the unlock/post to the table,   
   >and you are jumping in trying to change another field before it can complete.   
   >   
   >The easiest way around this is to delay your update, via a postAction, as   
   >in:   
   >   
   >;// following added:   
   >   
   >if eventInfo.id() = DataArriveRecord then   
   >;	ViewedOn.value = today()   
   >	ViewedOn.postAction(userAction + 123)   
   >endIf   
   >   
   >   
   >And then, in ViewedOn's Action() event, put in this code:   
   >   
   >if eventInfo.id() = userAction + 123 then   
   >	ViewedOn.value = today()   
   >endif   
   >   
   >HTH,   
   >Jim Moseley   
   >   
      
   Hi again Jim,   
      
   As you guessed, the code was on the action method of the   
   form...   
      
   We are making progress in that there are no further locking   
   errors, but nothing is being written to the Viewed field   
   when I arrive on a new record. I get no error, but nothing   
   is entered in the field.   
      
   In addition (and this may help diagnose this thing) if I   
   modify something on a record, the ModDate field changes to   
   today's date as it should, but then, I get an error telling   
   me that the field "Viewed" cannot be modified because I am   
   not in edit mode. (Also, and with apologies for any   
   confusion, the name of the field object is "Viewed" and the   
   name of its text area is "ViewedOn.")   
      
      
   That said, the form's action method now looks like this:   
      
   method action(var eventInfo ActionEvent)   
      
   var   
   endVar   
   	if eventInfo.isPreFilter() then   
   		;// This code executes for each object on the form:   
    if isEdit() then   
   	if eventInfo.id() = DataRefresh then   
   	  eventInfo.setErrorCode(UserError)   
   	endIf   
    endIf   
   	else   
   		;//This code executes only for the form:   
      
   if  (eventInfo.id() = DataPostRecord   
     and  active.RecordStatus("New"))   
   or  (eventInfo.id() = DataUnlockRecord   
     and (active.RecordStatus("Modified")   
   or   active.RecordStatus("Locked"))) then	   
   	ModDate.value = today()   
   endIf   
      
   if eventInfo.id() = DataArriveRecord then   
   	Viewed.postAction(userAction + 123)   
   endIf   
      
   endIf   
      
   endMethod   
      
      
      
   and the code on the action method of the field Viewed is:   
      
   method action(var eventInfo ActionEvent)   
      
   if eventInfo.id() = userAction + 123 then   
   	Viewed.value = today()   
   endif   
      
   endMethod   
      
      
      
   Thanks for any further help on this,   
   --   
   Kenneth   
      
   If you email... Please remove the "SPAMLESS."   
      
   --- 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