table1.onFilterRecord中加入以下代码:
begin
with table1 do
begin
if fieldByName('myField').asString= 'myCondition' then accept:=true
else accept:=false;
end;
end;
glink:
要求的是模糊查询,改一下你的程序如下
var pchar;
p:=strpos(pchar(fieldbyname('myfield').asstring),pchar('mycondition'));
if p=nil then accept:=false
else accept:=true
同意dedman,可以简化:
procedure tform1.table1onfilter;
begin
accept;=false;
if pos(‘condition’,fieldbyname(‘myfield’).asstring)<>0 then
accept;=true;
end;