unit KObarotS13;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,UDM, ExtCtrls, DBCtrls, StdCtrls, DB, ADODB, Grids, DBGrids;

type
  TForm13 = class(TForm)
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    ADOQuery1: TADOQuery;
    DBComboBox1: TDBComboBox;
    Panel1: TPanel;
    Button1: TButton;
    RadioGroup1: TRadioGroup;
    DBNavigator2: TDBNavigator;
    procedure RadioGroup1Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form13: TForm13;

implementation

{$R *.dfm}

procedure TForm13.Button1Click(Sender: TObject);
begin
ADOQuery1.Active:=false;
close();
end;

procedure TForm13.FormActivate(Sender: TObject);
begin
ADOQuery1.Open;
radiogroup1.ItemIndex:=2
end;

procedure TForm13.RadioGroup1Click(Sender: TObject);
begin
begin
case radiogroup1.ItemIndex of
0: begin
    ADOQuery1.Close;
    ADOQuery1.SQL.Text:='select * from  vidacha_knig31 where coctoianie="Долг" ';
    ADOQuery1.Open;
    end;
1: begin
   ADOQuery1.SQL.Text:='select * from  vidacha_knig31 where coctoianie="Сдана" ' ;
   ADOQuery1.Open;
    end;
2:  begin
   ADOQuery1.SQL.Text:='select * from  vidacha_knig31' ;
   ADOQuery1.Open;
    end;
end;
end;
end;

end.
