Topic: TextBox Validations

Hello ppl, i'm new with the program, and i'm very interested to learn a bit more.

I want to make a basic program with some input values in DB, but i want to validate myself the input values of some comboBox.

Example.
A table called client with a name on it and its not nullable.

then i try to save the record without any values it goes a default message: "NOT NULL: constraint failed..."

with this code i can see if there is any text on the combobox:

procedure frmNewClient_Button2_OnClick (Sender: string; var Cancel: boolean);
begin
   if frmNewClient.boxNome.Text = ''  then ShowMessage('wrong name');
end;

the problem is, i get my message and the default message.

There is an way to dont show the default message?

Re: TextBox Validations

Hello,


try this

procedure frmNewClient_Button2_OnClick (Sender: string; var Cancel: boolean);
begin
   if frmNewClient.boxNome.Text = ''  then 
   begin   
      ShowMessage('wrong name');
      Cancel := True;
   end;
end;
Dmitry.

Re: TextBox Validations

It workd very good thanks! big_smile


Can you guys create an api or some videos to help ppl how to use more the script funcion? big_smile

Re: TextBox Validations

Here you can find infotmation about Delphi (Object Pascal), My Visual Database uses almost same language.

http://delphi.about.com/od/beginners/a/dbeginner6.htm
http://www.delphibasics.co.uk/Article.asp?Name=FirstPgm
http://101.lv/learn/delphi/fm.htm

Dmitry.