Prevent a DBGrid from adding a register when it is positioned beyond the last
Useful when we want to give the opportunity to change data, but not of adding them.
Is enough to put this code inside the BeforeInsert event of the table:
Another manner to make it:
Put this code into OnkeyDown event of the DBGrid:
Rafa (email@example.com) said us:
What does it happen if they press the TAB key in the last column of the DBGrid...? HORROR!!! they adds a register...
Here is my code to solve it:
It is good, but... this is better:
Sent by: DARIO ALVAREZ ARANDA (firstname.lastname@example.org)
I have read the tip 59 and him fact some improvements to make it completely generic that can be good for any DBGrid, or for a group of DBGrid:
Updated at 28/02/2000
Updated at 07/09/2000