end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
TabControl1.Align := alClient;
TabControl1.TabHeight := 30;
with Table1 do
begin
Close;
IndexName := 'ByName';
Open;
while not EOF do
begin
TabControl1.Tabs.Add(FieldByName('LASTNAME').AsString);
Next;
end;
// Sync page and table.
First;
end;
end;
procedure TForm1.TabControl1Change(Sender: TObject);
begin
with TabControl1 do
begin
if TabIndex <> -1 then
if not Table1.Locate('LASTNAME', Tabs[TabIndex], []) then
ShowMessage(Tabs[TabIndex -1] + ' not found.');
end;
end;
procedure TForm1.Table1CalcFields(DataSet: TDataSet);
begin
DataSet['FullName'] := DataSet['LASTNAME'] + ', ' + DataSet['FIRSTNAME'];