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 9,565 of 9,834    |
|    Tony McGuire to Kenneth    |
|    Re: dataInsertRecord not Insertin'...?    |
|    09 Jan 09 08:53:02    |
   
   From: png.paradoxcommunity@com   
      
   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.   
      
   --   
   ---------------   
   Tony McGuire   
      
   --- 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