Delphi .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
Keep a dataset in dsInsert/dsEdit mode after validation fails
This article has not been rated yet. After reading, feel free to leave comments and rate it.
If you want to keep a dataset in dsInsert/dsEdit mode after a validation fails, but do not want to loose your input, use Abort in the BeforePost() event.
(If you would use Dataset.Cancel, you'd loose the input and return to browse mode.)
 | |  | | procedure TForm1.Table1BeforePost(DataSet: TDataSet);
begin
if Table1ID.Value <= 0 then
begin
Showmessage('Error! Invalid value!');
Abort
end
else
Table1.Post;
end; | |  | |  |
Comments:
|