procedure Tcxform.suiButton1Click(Sender: TObject); var xxx:String; begin if suiComboBox1.Text='录入时间' then xxx:='inputtime'; if suiComboBox1.Text='录入人员' then xxx:='inputman'; if suiComboBox1.Text='所属区域' then xxx:='qyfield'; if suiComboBox1.Text='纳税人管理码' then xxx:='qyno'; if suiComboBox1.Text='纳税人名称' then xxx:='qyname'; AdoTable1.Active:=False; DataSource1.DataSet:=AdoQuery2; AdoQuery2.Close; AdoQuery2.SQL.Clear; AdoQuery2.SQL.Add('select qyno as 企业管理码,qyname as 纳税人名称,qyfield as 所属区域,checkman as 信息核对人,checktime as 核对时间,'); AdoQuery2.SQL.Add('change as 变化信息说明,chuli as 处理意见,inputman as 录入人员,inputtime as 录入时间 from biao1 where '+xxx+Trim(suiComboBox2.Text)+''''+Trim(suiComboBox3.Text)+''' order by inputtime'); AdoQuery2.Open; if AdoQuery2.RecordCount=0 then Application.MessageBox('未找到相关的记录!','提示!',0+64); end;
----------------------------------------------
-相互学习,共同进步!