Subject | Re: [IBO] Validating a field |
---|---|
Author | Helen Borrie |
Post date | 2005-09-14T21:59:08Z |
At 08:03 PM 14/09/2005 +0000, you wrote:
validations in one handler. OnValidateFields fires and OnValidateField
event for each field in the row. Click on the OnValidateFields member in
the Object Inspector's Events list and you will get this template:
procedure TForm1.IB_Query1ValidateField(Sender: TIB_Statement;
ARow: TIB_Row; AField: TIB_Column);
begin
....
end;
ARow is the current Fields[] array, through which you can access individual
fields using the ByName method; or you can test for each individual field
through the AField property, e.g.
with AField do begin
if Name = 'SomeField' then
begin
........
end
else ..........
Helen
>I need some help on how to validate a field with IBO.It's not so different; except in IBO you can code all of your fields
>Before using IBO, I did it this way:
>1) right-button click the Query object on DataModule and choose Fields
>Editor
>2) select a field and double-click on its OnValidate event
>3) write code to test some conditions
>I am using a TIB_Grid linked to a TIB_DataSource and a TIB_Query.
>The user can type values for the fields on the TIB_Grid and I need to
>validate it. But I couldn't yet figure out how to do this kind of
>validation with IBO. I couldn't find it on IBObjects Home Page FAQ.
validations in one handler. OnValidateFields fires and OnValidateField
event for each field in the row. Click on the OnValidateFields member in
the Object Inspector's Events list and you will get this template:
procedure TForm1.IB_Query1ValidateField(Sender: TIB_Statement;
ARow: TIB_Row; AField: TIB_Column);
begin
....
end;
ARow is the current Fields[] array, through which you can access individual
fields using the ByName method; or you can test for each individual field
through the AField property, e.g.
with AField do begin
if Name = 'SomeField' then
begin
........
end
else ..........
Helen