Subject | Problem with Calculated fields. IBO Newbie, D6 and IB6 Intermediate |
---|---|
Author | Vincent Bergeron |
Post date | 2002-03-20T16:59:31Z |
Hi!
I Have a simple query.
Select * from Client in a TIB_Query. This TIB_Query's name is dbBug.
I have a CalculatedField: C_CALCNOTEL varchar(25)
In the OnCalculateField event, I have theses lines:
with AField do
begin
if FieldName = 'C_CALCNOTEL' then
begin
asString := '('+ARow.ByName('C_CodeNoTel').asString+')'+
ARow.ByName('C_NoTel').asString;
if ARow.ByName('C_NoTelPoste').asString <> '' then
asString := asString + '#' +
ARow.ByName('C_NoTelPoste').asString;
end;
end;
In the OnKeyPress of a TEdit, I have theses lines:
if key = #13 then
begin
key := #0;
if Edit1.Text <> '' then
begin
dbBug.Locate('C_Nom', VarArrayOf([Edit1.Text]),
[lopCaseInsensitive]);
end;
end;
The TEdit purpose is to look for a particular name in the table.
Finally, I have a grid that display about 10-15 records.
Now... in the TEdit, when I enter a name that's not shown in the DBGrid, I
get the following error:
"Project Project1.exe raised exception class EIB_StatementError with message
'FieldName: C_NoTelPoste not found'. Process stopped. Use Step or Run to
continue'
If I'm unclear, I've made a sample application that illustrate my behavior.
Thank you for your time.
VB
[Non-text portions of this message have been removed]
I Have a simple query.
Select * from Client in a TIB_Query. This TIB_Query's name is dbBug.
I have a CalculatedField: C_CALCNOTEL varchar(25)
In the OnCalculateField event, I have theses lines:
with AField do
begin
if FieldName = 'C_CALCNOTEL' then
begin
asString := '('+ARow.ByName('C_CodeNoTel').asString+')'+
ARow.ByName('C_NoTel').asString;
if ARow.ByName('C_NoTelPoste').asString <> '' then
asString := asString + '#' +
ARow.ByName('C_NoTelPoste').asString;
end;
end;
In the OnKeyPress of a TEdit, I have theses lines:
if key = #13 then
begin
key := #0;
if Edit1.Text <> '' then
begin
dbBug.Locate('C_Nom', VarArrayOf([Edit1.Text]),
[lopCaseInsensitive]);
end;
end;
The TEdit purpose is to look for a particular name in the table.
Finally, I have a grid that display about 10-15 records.
Now... in the TEdit, when I enter a name that's not shown in the DBGrid, I
get the following error:
"Project Project1.exe raised exception class EIB_StatementError with message
'FieldName: C_NoTelPoste not found'. Process stopped. Use Step or Run to
continue'
If I'm unclear, I've made a sample application that illustrate my behavior.
Thank you for your time.
VB
[Non-text portions of this message have been removed]