
03.08.2009, 18:41
|
 |
Начинающий
|
|
Регистрация: 05.08.2008
Сообщения: 115
Репутация: 12
|
|
Вот, я переделал код на такой:
Код:
procedure TForm8.BitBtn8Click(Sender: TObject);
var
i,k,j: integer;
begin
if Form8.Table_jur.Locate('Fam_jur;Imy_jur;Otche_jur',VarArrayOf([Form8.StringGrid1.Cells[1,j],
Form8.StringGrid1.Cells[2,j],Form8.StringGrid1.Cells[3,j]]),
[loCaseInsensitive,loPartialKey]) = False then
for i:=4 to Form8.StringGrid1.ColCount - 1 do
for j:=1 to 25 do
if Form8.StringGrid1.Cells[0,j] <> '' then
if Form8.StringGrid1.Cells[1,j] <> '' then
if Form8.StringGrid1.Cells[2,j] <> '' then
if Form8.StringGrid1.Cells[3,j] <> '' then
if Form8.StringGrid1.Cells[i,0] <> '' then
begin
Form8.Table_jur.Insert;
Form8.Table_jur.FieldByName('Data').AsString:=Form8.StringGrid1.Cells[i,0];
Form8.Table_jur.FieldByName('Fam_jur').AsString:=Form8.StringGrid1.Cells[1,j];
Form8.Table_jur.FieldByName('Imy_jur').AsString:=Form8.StringGrid1.Cells[2,j];
Form8.Table_jur.FieldByName('Otche_jur').AsString:=Form8.StringGrid1.Cells[3,j];
Form8.Table_jur.Post;
end;
Результат внесения представлен во вложении. Какого условия не хватает, чтобы было так как я выкладывал в первом своем посте??
|