?? js310unit.pas
字號:
unit JS310Unit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, PublicUnit, jpeg, ExtCtrls, DBCtrls, StdCtrls, Grids, DBGrids;
type
TJS310Form = class(TPublicUnit)
DBGrid1: TDBGrid;
Panel1: TPanel;
Label2: TLabel;
ComboBox1: TComboBox;
Button7: TButton;
Button8: TButton;
Button9: TButton;
DBNavigator1: TDBNavigator;
procedure ComboBox1DropDown(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JS310Form: TJS310Form;
implementation
uses DMUnit;
{$R *.dfm}
procedure TJS310Form.ComboBox1DropDown(Sender: TObject);
var
I: Integer;
begin
inherited;
combobox1.Clear;
with DM.Querytemp do
begin
SQL.clear;
SQl.Text := 'select 結算單位 from 結算分單 ';
Close;
Active := False;
prepared := False;
prepared := True;
Active := True;
if (recordcount > 0) then
first;
for i := 0 to recordcount - 1 do
begin //取得該列所有的數據到combobox2控件中
combobox1.Items.add(FieldByName('結算單位').asstring);
next;
end;
end;
end;
procedure TJS310Form.Button9Click(Sender: TObject);
begin
inherited;
Close;
end;
procedure TJS310Form.Button7Click(Sender: TObject);
begin
inherited;
{--- 判斷搜索的條件是否為空 ---}
if Combobox1.Text <> '' then
begin
with DM.Querytemp do
begin
SQL.Clear;
SQl.Text := 'select * from 結算分單 where 結算單位 like '
+ #39 + '%' + trim(combobox1.Text) + '%' + #39;
Close;
Active := False;
prepared := False;
prepared := True;
Active := True;
open;
DBGrid1.DataSource := DM.dsQuerytemp;
DBNavigator1.DataSource := DM.dsQuerytemp;
end;
end
else
MessageBox(0, '搜尋條件錯誤', '錯誤', MB_OK + MB_ICONSTOP);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -