From: usenet@soleSPAMLESSassociates.com   
      
   On Fri, 09 Jan 2009 08:53:02 -0700, Tony McGuire   
    wrote:   
      
   >Kenneth wrote:   
   >>   
   >> method action(var eventInfo ActionEvent)   
   >> var   
   >> tc2 tCursor   
   >> endVar   
   >>   
   >> if eventInfo.id()=dataInsertRecord then   
   >>   
   >> DoDefault   
   >>   
   >> if not tc2.open(":MONEY:EntryNum.DB") then   
   >> errorShow()   
   >> endIf   
   >>   
   >> EntryNumber = tc2.entryNum   
   >>   
   >> tc2.edit()   
   >> tc2.entryNum = EntryNumber + 1   
   >> edit()   
   >> entry = tc2.entryNum   
   >> tc2.endEdit()   
   >> tc2.close()   
   >>   
   >> endIf   
   >> endMethod   
   >   
   >You have 'edit()' as part of the routine INSIDE the if eventinfo.id() block.   
   >   
   >Are you sure it is in edit mode to start with? Cause the above would fail the   
   >first time and work (likely) the second and subsequent times (sound like what   
   >you are getting?) if the form wasn't in edit to start.   
   >   
   >Also, if the tc2.open you have errorshow(); I would add 'return' to that since   
   >you don't want errors cropping up when your code starts referencing a tcursor   
   >that didn't get opened.   
   >   
   >Is this code going to be used by more than one person; ever? Actully, the   
   >table 'entrynumb.db'. If so, this code needs (critically) to be revisited   
   >once you get the main issue resolved.   
      
   Hi Tony,   
      
   I removed the endEdit() as you suggested.   
      
   Now, if I launch the form, and touch the Insert Key, a new   
   blank record opens as it should, but the Entry Number   
   increments by 2, rather than 1.   
      
   If I then populate that record, and touch Insert again, a   
   new blank record opens and the counter increments by 1.   
      
   Also, this is STRICTLY a one person form, and so there is no   
   issue with regard to properly locking the entrynum.db.   
      
   Very sincere thanks for your help,   
   --   
   Kenneth   
      
   If you email... Please remove the "SPAMLESS."   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|