Fórum passar dados entre tabela #328900
07/09/2006
0
begin
with dtPrincipal do
if not ConfEmprestimo.Eof then
begin
ConfEmprestimo.Open;
ConfEmprestimo.Append;
ConfEmprestimoCODDEVOL.Text := EmprestimoCODARQUIVO.Text;
ConfEmprestimoUSUARIO.Text := EmprestimoUSUARIO.Text;
ConfEmprestimoAREA.Text := EmprestimoAREA.Text;
ConfEmprestimoITEN_DOC.Text := EmprestimoITEM_DOC.Text;
ConfEmprestimoDOSSIE.Text := EmprestimoDOSSIE.Text;
ConfEmprestimoDATA.Text := EmprestimoDATA.Text;
ConfEmprestimoCOMPLEMENTO.Text := EmprestimoCOMPLEMENTO.Text;
ConfEmprestimoLOCALIZACAO.Text := EmprestimoLOCALIZACAO.Text;
ConfEmprestimoCAIXA.Text := EmprestimoCAIXA.Text;
ConfEmprestimo.Post;
ConfEmprestimo.Next;
end;
so q naum esta passando nada para a outra tabela alguem tem uma ideia ou outra farma d fazer isso estou usando o codigo no onkeypress ja usei em um monte d lugar e naum deu certo tambem
Tchucky
Curtir tópico
+ 0Posts
07/09/2006
Rm
procedure....
begin
Tabelaoriginal.first;//não esqueça.
While not tabelaoriginal.eof do begin
tabelaquerecebe.insert
tabelaquerecebecampo1.value:=tabelaoriginalcampo1.value;
tabelaquerecebecampo2.value:=tabelaoriginalcampo2.value;
tabelaquerecebe.post;
tabelaoriginal.next;
end;
Tabelaoriginal.first
tabelaquerecebe.first
end;
No codigo para copiar os campos pode ter ifs condicionais etc.
Espero que seja de alguma valia...
Gostei + 0
08/09/2006
Marco Salles
Acho eu que o mais indicado é criar um trigger para isto...
Gostei + 0
08/09/2006
Tchucky
Gostei + 0
08/09/2006
Paullsoftware
:arrow: no evento AffterPost da Tabela1 tente assim:
Tabela2.Open; Tabela2.Insert; Tabela2Campo1.Value := Tabela1Campo1.Value; Tabela2Campo2.Value := Tabela1Campo2.Value; Tabela2Campo3.Value := Tabela1Campo3.Value; Tabela2CampoN.Value := Tabela1CampoN.Value; Tabela2.Post; Tabela2.Close;
[b:dae034d938][color=red:dae034d938]caso continue sem funcionar, diga qual banco esta usando, Componentes de conexão com o banco, se usa BDE ou não, se está apresentando algum erro, etc...[/color:dae034d938][/b:dae034d938]
Gostei + 0
08/09/2006
Tchucky
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)