On Monday 17 November 2008 10:39:41 pm Roger Lovelock wrote: > Aaaah! > > Compilation error with the second option was a typo by me. Second option > works the same as the first. > > The reason appears to be that if the database has a NOT NULL condition this > takes precedence over the validation routine ie validation test does not > take place and the update is ignored. Also I redid the validation just to > test if the field was under 4 in length. I then shortened the field to 3 > chars. Validation worked fine ie I got the error message and the save was > cancelled BUT the working data stayed at the shortened field even if I > moved to other records and returned. I assume that this means that if I get > an error in the validation routine I should do a requery. Rodgy
If I understand you correctly a requery is NOT required. If the Validation fails - it is as if you did not call save(). On my forms I actually setFocus() on the problem control (normally a textbox). And if the user fixes the problem control and does a save() - all works. > BUT the working data stayed at the shortened field even if I > moved to other records and returned. This sounds like correct behavior. Dabo keeps a cusor and depending how you moved to new records (maybe a grid) would keep the infomation entered. I bet if you closed the form. Dabo would ask if you wanted to save. BTW with a text control I use if fieldValue is None or fieldValue == '' -- John Fabiani _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
