Subject Re: [IBO] FocusControl?
Author Salvatore Besso
hello Helen,

> What do you want to do? The TIB_Dataset already calls
> this method itself during the CheckRequiredFields period
> of BeforePost.

yes, of course, but in the on before post event of the query I'm doing some
extra checks on some fields, and if something is wrong I'd like to focus
the associated control:

var
TmpFld: TIB_Column;

begin
for I := 0 to Pred(My_IB_Query.FieldCount) do
begin
TmpFld := My_IB_Query.Fields[I];
if Assigned(TmpFld) and TmpFld.Visible then
try
if TmpFld.FieldName = 'SOMENAME' then
begin
Make some test on field SOMENAME;
if Something wrong then
raise EBadValueError.Create('The value is bad')
end;
.....
except
on E: EBadValueError do
begin
TmpFld.FocusControl;
raise
end
end
end
end;

The problem is that TmpFld.FocusControl does nothing. But maybe it's not
the correct usage?

Regards
Salvatore