INSERT INTO T_PCont ( IdLocal, [Local], IdOcorr, Ocorr, NameOcorr, IdProc,
Proc, NProc )
SELECT T_Locals.IdLocal, T_Locals.Local, T_Ocorr.IdOcorr, T_Ocorr.Ocorr,
T_Ocorr.NameOcorr, T_Proc.IdProc, T_Proc.Proc, T_NProc.NProc
FROM T_Proc, T_Ocorr, T_NProc, T_Locals
WHERE (((T_Locals.IdLocal)=[Forms].[F_PCont].[txtIdLocal]) AND
((T_Locals.Local)=[Forms].[F_PCont].[txtLocal]) AND
((T_Ocorr.IdOcorr)=[Forms].[F_PCont].[txtIdOcorr]) AND
((T_Ocorr.Ocorr)=[Forms].[F_PCont].[txtOcorr]) AND
((T_Ocorr.NameOcorr)=[Forms].[F_PCont].[txtNameOcorr]) AND
((T_Proc.IdProc)=[Forms].[F_PCont].[txtIdProc]) AND
((T_Proc.Proc)=[Forms].[F_PCont].[txtProc]) AND
((T_NProc.NProc)=[Forms].[F_PCont].[cboNProc]));
You're joining *four* tables without ANY join clause or criteria. If any one
of these tables has two records in it you'll see two records in the result; if
two tables each have two records you'll see all four possible combinations; if
each table has ten records you'll see all 10,000 possible combinations.
What are the logical relationships between T_Proc, T_OCorr, T_NProc and
T_Locals? Have you assigned primary keys to all four tables? Have you defined
Relationships between them?
John W. Vinson [MVP]