>Thanks Hilmar ! I apreciate that, never through on my mind using PendingChanges() and AskToSave()...but now i think i have to use those methods...Thanks a lot
>
>Best regards
>Winarto.
Of course, for code re-use, you should have this kind of methods in your base classes. Let me explain briefly, in case you are not familiar with classes and inheritance.
For example, you can have a form class, which might be called cDataForm, for managing single tables (managing multiple tables is more complicated). Then, derive several forms (list of clients, list of products, etc.) from this class. Any change you do in the class will be reflected in each form. Thus, if you detect an error in your code, you have to fix it in one single place.
But first, try it with a single form, before you convert this form to a class.
Also: Methods like AskToSave() (or some method that checks for pending changes) should be called in a variety of situations, for example, when the user tries to:
Close the form.
Go to the next record, the previous record, the first or the last record.
Select an order - if this sorting sequence goes to the first record according to the selected order.
Set a filter, if you have enabled that option.
Greetings,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)