home *** CD-ROM | disk | FTP | other *** search
- unit DemoTableLookup;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- DB, DBTables, Grids, DBGrids, DBCtrls, StdCtrls;
-
- type
- TFormTableLookup = class(TForm)
- TblMain: TTable;
- SrcMain: TDataSource;
- DBGrid1: TDBGrid;
- TblLookList: TTable;
- SrcLook: TDataSource;
- Adr_PersID: TDBLookupListBox;
- TblLookCombo: TTable;
- SrcTrans: TDataSource;
- DBLookupComboBox1: TDBLookupComboBox;
- TblMainAdr_ID: TAutoIncField;
- TblMainAdr_PersID: TIntegerField;
- TblMainAdr_Street: TStringField;
- TblMainAdr_ZIP: TStringField;
- TblMainAdr_Place: TStringField;
- TblMainAdr_Country: TStringField;
- DropIndexList: TComboBox;
- Label1: TLabel;
- procedure FormCreate(Sender: TObject);
- procedure DropIndexListClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- FormTableLookup: TFormTableLookup;
-
- implementation
-
- {$R *.DFM}
-
- procedure TFormTableLookup.FormCreate(Sender: TObject);
- var
- i: integer;
- begin
- TblMain.Open;
- TblLookList.Open;
- TblLookCombo.Open;
- {fill index list}
- with TblMain.IndexDefs do begin
- for i:= 0 to Count-1 do DropIndexList.Items.Add( Items[i].Name );
- end {with TblMain};
- DropIndexList.ItemIndex:= 0;
- TblMain.IndexName:= DropIndexList.Text;
- end {FormCreate};
-
- procedure TFormTableLookup.DropIndexListClick(Sender: TObject);
- begin
- with DropIndexList do begin
- TblMain.IndexName:= Text;
- end {with DropIndexList};
- end;
-
- end.
-