Subject | Change of ordering of underlaying query of TIB_LookupCombo "on the fly"... |
---|---|
Author | Tibor BELAN |
Post date | 2001-11-28T08:45:46Z |
I would like to change ordering of TIB_LookupCombo
(ordering of underlaying TIB_Query, of course) "on the
fly":
in lookup table CITY I have three fields CITY_CODE
CHAR(5) = PRIMARY KEY, POSTAL_CODE CHAR(5) - only
digits and CITY_NAME VARCHAR(50) - only ALPHA
characters... Everythings works fine, display field of
TIB_LookupCombo is CITY_NAME, etc... but I would like
to change ordering of lookup table in dependence
whether user type digits (ordering postal_code) or
alphas (ordering city_name).
I trap this situation in OnKeyPress event of
TIB_LookupCombo, if OrderingItemNo of underlaying
TIB_Query needs to change (previous character was
ALPHA, next is DIGIT and vice versa...), I call this
sequence:
procedure
TfrmMain.cmbCustomerCityLookupKeyPress(Sender:
TObject; var Key: Char);
begin
with qryCustomerCityLookup, cmbCustomerCityLookup do
begin
if (Key in ['0'..'9']) then
begin
if not(OrderingItemNo = 1) then
begin
OrderingItemNo := 1;
ClearIncSearchString;
end
end
else
begin
if not(OrderingItemNo = 2) then
begin
OrderingItemNo := 2;
ClearIncSearchString;
end;
end;
end;
end;
Everything is working fine until user typed the "new"
sequence of character (sequence, which needs to change
ordering) too quickly... In this case I have got
Exception EIB_DataSet error "Unable to perform search"
generated in this snippet of code from
IBA_BDataset.IMP:
function TIB_BDataset.IncSearchString( AString:
string;
StartRowNum:
longint;
SeekNearest:
boolean ): boolean;
var
tmpIncSearchLevel: integer;
ExactMatchFound: boolean;
begin
....
if FIncSearchLevel = 0 then
begin
if Refreshing or Fetching then
raise EIB_DatasetError.Create( E_UnableToSearch
);
FIncSearchMaxLevel := 0;
end;
....
What I'm doing the wrong way? I try to change
qryCustomerCityLookup.ClearIncSearchString ->
cmbCustomerCityLookup.ClearSelection(), change order
of calls to this methods, etc..., but the effect is
the same: everything is fine until user type "new"
sequence too quickly...
Thanks in advance for your answer...
Tibor BELAN
belan@...
P.S.: Sorry for my poor english
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1
(ordering of underlaying TIB_Query, of course) "on the
fly":
in lookup table CITY I have three fields CITY_CODE
CHAR(5) = PRIMARY KEY, POSTAL_CODE CHAR(5) - only
digits and CITY_NAME VARCHAR(50) - only ALPHA
characters... Everythings works fine, display field of
TIB_LookupCombo is CITY_NAME, etc... but I would like
to change ordering of lookup table in dependence
whether user type digits (ordering postal_code) or
alphas (ordering city_name).
I trap this situation in OnKeyPress event of
TIB_LookupCombo, if OrderingItemNo of underlaying
TIB_Query needs to change (previous character was
ALPHA, next is DIGIT and vice versa...), I call this
sequence:
procedure
TfrmMain.cmbCustomerCityLookupKeyPress(Sender:
TObject; var Key: Char);
begin
with qryCustomerCityLookup, cmbCustomerCityLookup do
begin
if (Key in ['0'..'9']) then
begin
if not(OrderingItemNo = 1) then
begin
OrderingItemNo := 1;
ClearIncSearchString;
end
end
else
begin
if not(OrderingItemNo = 2) then
begin
OrderingItemNo := 2;
ClearIncSearchString;
end;
end;
end;
end;
Everything is working fine until user typed the "new"
sequence of character (sequence, which needs to change
ordering) too quickly... In this case I have got
Exception EIB_DataSet error "Unable to perform search"
generated in this snippet of code from
IBA_BDataset.IMP:
function TIB_BDataset.IncSearchString( AString:
string;
StartRowNum:
longint;
SeekNearest:
boolean ): boolean;
var
tmpIncSearchLevel: integer;
ExactMatchFound: boolean;
begin
....
if FIncSearchLevel = 0 then
begin
if Refreshing or Fetching then
raise EIB_DatasetError.Create( E_UnableToSearch
);
FIncSearchMaxLevel := 0;
end;
....
What I'm doing the wrong way? I try to change
qryCustomerCityLookup.ClearIncSearchString ->
cmbCustomerCityLookup.ClearSelection(), change order
of calls to this methods, etc..., but the effect is
the same: everything is fine until user type "new"
sequence too quickly...
Thanks in advance for your answer...
Tibor BELAN
belan@...
P.S.: Sorry for my poor english
__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1