procedure Tfmchaxun.SpeedButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfmchaxun.SpeedButton2Click(Sender: TObject);
begin
combobox1.Text:='';
edit1.Text:='';
combobox2.Text:='';
end;
procedure Tfmchaxun.ComboBox1Change(Sender: TObject);
begin
edit1.Text:='';
edit1.SetFocus;
combobox2.Text:='';
if (combobox1.Text='楼层')or (combobox1.Text='房间号') then
begin
label3.Visible:=true;
combobox2.Visible:=true;
messagebeep(0);
end
else
label3.Visible:=false;
combobox2.Visible:=false;
if combobox1.Text='姓名' then
begin
chaxunziduan:='xingming';
exit;
end;
if combobox1.Text='系名' then
begin
chaxunziduan:='xi';
exit;
end;
if combobox1.Text='班级' then
begin
chaxunziduan:='banji';
exit;
end;
if combobox1.Text='楼名' then
begin
chaxunziduan:='louming';
exit;
end;
if combobox1.Text='楼层' then
begin
chaxunziduan:='louceng';
exit;
end;
if combobox1.Text='房间号' then
begin
chaxunziduan:='fangjian';
exit;
end;
end;
procedure Tfmchaxun.SpeedButton1Click(Sender: TObject);
begin
if combobox1.Text='' then
begin
showmessage('你还没选择查询字段,请确认!');
combobox1.SetFocus;
exit;
end;
if edit1.Text='' then
begin
showmessage('你还没输入查询值,请确认!');
edit1.SetFocus;
exit;
end;
if (combobox2.Text='')or (combobox2.Visible=false) then
begin
PfmMain.Table1.Filtered:=false;
PfmMain.Table1.Filter:=chaxunziduan+'='+''''+edit1.Text+'''';
PfmMain.Table1.Filtered:=true;
if fanhui() then
begin
messagebeep(0);
showmessage('SORRY!没有找到相关记录!');
end;
exit;
end
else
begin
PfmMain.Table1.Filtered:=false;
PfmMain.Table1.Filter:=chaxunziduan+'='+''''+edit1.Text+''''+' and louming'+'='+''''+combobox2.Text+'''';
PfmMain.Table1.Filtered:=true;
if fanhui() then
begin
messagebeep(0);
showmessage('SORRY!没有找到相关记录!');
end;
exit;
end;
end;
procedure Tfmchaxun.FormClose(Sender: TObject; var Action: TCloseAction);
begin
PfmMain.Table1.Close;
PfmMain.Table1.Filter:='';
PfmMain.Table1.Open;
end;
procedure Tfmchaxun.SpeedButton4Click(Sender: TObject);
begin
fmxshbaobiao:=Tfmxshbaobiao.Create(self);
try
fmxshbaobiao.QuickRep1.Preview;
finally
fmxshbaobiao.Free;
end;
end;
procedure Tfmchaxun.SpeedButton3Click(Sender: TObject);
begin
fmxshbaobiao:=Tfmxshbaobiao.Create(self);
try
fmxshbaobiao.QuickRep1.Print;
finally
fmxshbaobiao.Free;
end;
end;end.