procedure Tbafm.BitBtn2Click(Sender: TObject); typeTtab = Record td1,td2,td5,td6,td7,td8,td9: String;end;var tab:array of Ttab; i:integer;begin begin setLength(Tab,dbfm.tdqry1.RecordCount); i := 0; with dbfm.tdqry1 do while not eof do begin tab.td1:=Edit1.text;//此为主表的账单号 tab.td2:=fieldbyname('td002').AsString;//此处为点菜内容 tab.td5:=fieldbyname('td005').AsString; tab.td6:=fieldbyname('td006').AsString; tab.td7:=fieldbyname('td007').AsString; tab.td8:=fieldbyname('td008').AsString; tab.td9:=fieldbyname('td009').AsString; next; inc(i); end; for i := 0 to length(Tab) -1 do begin dbfm.tdqry1.append; dbfm.tdqry1.fieldbyname('td001').AsString := tab.td1; dbfm.tdqry1.fieldbyname('td002').AsString := tab.td2; dbfm.tdqry1.fieldbyname('td005').AsString := tab.td5; dbfm.tdqry1.fieldbyname('td006').AsString := tab.td6; dbfm.tdqry1.fieldbyname('td007').AsString := tab.td7; dbfm.tdqry1.fieldbyname('td008').AsString := tab.td8; dbfm.tdqry1.fieldbyname('td009').AsString := tab.td9; end; dbfm.tdqry1.Refresh; end; end;end;