?? jh_fk_find_unit.pas
字號:
unit jh_fk_find_unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
Tjh_fk_find_form = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit;
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
jh_fk_find_form: Tjh_fk_find_form;
implementation
uses data_unit, jh_unit;
{$R *.dfm}
procedure Tjh_fk_find_form.SpeedButton2Click(Sender: TObject);
begin
close;
end;
procedure Tjh_fk_find_form.SpeedButton1Click(Sender: TObject);
begin
with database do
begin
adoq3.Connection := adoc;
adoq3.SQL.Clear;
case combobox1.ItemIndex of
0:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from jhfk where 單據編碼=:bm');
adoq3.Parameters.ParamByName('bm').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from jhfk where 單據編碼 like :bm2');
adoq3.Parameters.ParamByName('bm2').Value := edit1.Text + '%';
end;
end;
end;
1:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from jhfk where 供貨商名稱=:lx');
adoq3.Parameters.ParamByName('lx').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from jhfk where 供貨商名稱 like :lx2');
adoq3.Parameters.ParamByName('lx2').Value := edit1.Text + '%';
end;
end;
end;
2:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from jhfk where 經手人=:jsr');
adoq3.Parameters.ParamByName('jsr').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from jhfk where 經手人 like :jsr2');
adoq3.Parameters.ParamByName('jsr2').Value := edit1.Text + '%';
end;
end;
end;
3:
begin
case combobox2.ItemIndex of
0:
begin
adoq3.SQL.Add('select * from jhfk where 發票類型=:fplx');
adoq3.Parameters.ParamByName('fplx').Value := edit1.Text;
end;
1:
begin
adoq3.SQL.Add('select * from jhfk where 發票類型 like :fplx2');
adoq3.Parameters.ParamByName('fplx2').Value := edit1.Text + '%';
end;
end;
end
else
begin
adoq3.SQL.Clear;
adoq3.SQL.Add('select * from jhfk order by 錄單日期');
end;
end;
adoq3.Active := true;
if adoq3.Recordset.RecordCount > 0 then
begin
datas2.DataSet := nil;
datas2.DataSet := adoq3;
self.Hide;
jh_form.DBGrid1.DataSource := datas2;
jh_form.statusbar1.Panels[1].Text := inttostr(adoq3.Recordset.RecordCount);
end
else
showmessage('無此記錄!');
end;
end;
procedure Tjh_fk_find_form.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = vk_return then
speedbutton1click(nil);
end;
procedure Tjh_fk_find_form.FormCreate(Sender: TObject);
begin
self.Height := 147;
self.Top := 110;
self.Left := 221;
self.Width := 339;
end;
end.
//此源碼由程序太平洋收集整理發布,任何人都可自由轉載,但需保留本站信息
//╭⌒╮┅~ ¤ 歡迎光臨程序太平洋╭⌒╮
//╭⌒╭⌒╮╭⌒╮~╭⌒╮ ︶ ,︶︶
//,︶︶︶︶,''︶~~ ,''~︶︶ ,''
//╔ ╱◥███◣═╬╬╬╬╬╬╬╬╬╗
//╬ ︱田︱田 田 ︱ ╬
//╬ http://www.5ivb.net ╬
//╬ ╭○╮● ╬
//╬ /■\/■\ ╬
//╬ <| || 有希望,就有成功! ╬
//╬ ╬
//╚╬╬╬╬╬╬╬╬╬╬╗ ╔╬╬╬╬╝
//
//說明:
//專業提供VB、.NET、Delphi、ASP、PB源碼下載
//包括:程序源碼,控件,商業源碼,系統方案,開發工具,書籍教程,技術文檔
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -