Topic: Check values before saving

Hi there,

I am looking for a script which would check if the value already exists in a column and if so, display a warning without saving and/or a script to implement a maximum value to input in a field with a warning of same kind as before.

The aim would be to control what is going to be filled in a column.

If value a > 100 = block and display max value acceptable (no save) --> click ok and try something else
If value a already exists = display warning: value already exists. (no save) --> click ok and try something else
If value acceptable = save value

Re: Check values before saving

Hello,

how to check value:

procedure Form2_ButtonSave_OnClick (Sender: string; var Cancel: boolean);
begin
    if Form2.Edit1.Value > 100 then
    begin
        ShowMessage('max value is 100');
        Cancel := True;
    end;
end;


here you can download an example, how to check already exists records before save
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

3 (edited by tcoton 2015-05-12 11:52:00)

Re: Check values before saving

Hi Dmitry,

thanks again, you are the fastest!

Just 2 questions:

1 - How could I customize the message window title?


http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=953




2 - How could I set the max value to be checked with a sql query? (programming is not yet my greatest skill)

Post's attachments

Attachment icon msg_windows.jpg 16.9 kb, 344 downloads since 2015-05-12 

Re: Check values before saving

tcoton
1. It's not supported in the current version.


2. No.

Dmitry.