Thx a lot Dmitry...........................
I've tested MVD v 3.21beta but it didn't work at my end.
For instance, on groups combo typing J and hitting space clears combo list then typing more after space doesn't make any difference.
You have applied to on form1 groups combo. I tried to apply same script with some edit to frmInvoice combo and it didn't accept any any input?
procedure frmInvoice_cbCustomer_OnKeyPress (Sender: string; var Key: Char);
var
id: integer;
ar: array of string;
begin
if ord(Key)= 13 then
begin
id := frmInvoice.cbCustomer.dbItemID;
frmInvoice.cbCustomer.DroppedDown:=False;
frmInvoice.cbCustomer.dbItemID := id;
Key := #0;
Exit;
end;
if ord(Key)= 8 then // for backspace button
begin
s_cbCustomer := '';
frmInvoice.cbCustomer.Text := '';
frmInvoice.cbCustomer.dbUpdate; //UpdateDatabase('person');
Key := #0;
frmInvoice.cbCustomer.DroppedDown:=False;
frmInvoice.cbCustomer.dbItemID := -1;
Exit;
end;
s_cbCustomer := s_cbCustomer + Key;
Key := #0;
ar := SplitString(s_cbCustomer, ' ');
if (Length(ar)=2) and (ar[1]<>'') then
frmInvoice.cbCustomer.dbFilter := '(firstname LIKE '''+ ar[0] +'%'') AND (lastname LIKE '''+ar[1]+'%'')'
else
frmInvoice.cbCustomer.dbFilter := '(lastname LIKE ''%'+ s_cbCustomer +'%'''+')';
frmInvoice.cbCustomer.dbUpdate;
frmInvoice.cbCustomer.DroppedDown:=True;
frmInvoice.cbCustomer.Text := s_cbGroups;
frmInvoice.cbCustomer.SelStart := Length(s_cbCustomer);
end;
procedure frmInvoice_cbCustomer_OnCloseUp (Sender: string);
var
id: integer;
begin
id := frmInvoice.cbCustomer.dbItemID;
frmInvoice.cbCustomer.dbFilter := '';
frmInvoice.cbCustomer.dbUpdate; //UpdateDatabase('person');
frmInvoice.cbCustomer.dbItemID := id;
s_cbCustomer := '';
end;
Adam
God... please help me become the person my dog thinks I am.