T
tbrogdon
I have an append query that worked perfectly up until an hour ago
when I decided to fiddle with the primary key of the destination table
and now I am receiving the dreaded key violation warning.
Here is my sql:
PARAMETERS forms![frmSetEmpHours]![txtDate] DateTime;
INSERT INTO EmployeeProduction ( EmployeeID, ProductionDate,
Department, Shift, JobFunctionID )
SELECT Employees.EmployeeID, forms!frmSetEmpHours!txtDate AS
ProductionDate, Employees.Department, Employees.Shift,
Employees.JobFunctionID
FROM Employees
WHERE (((Employees.Department)=forms!frmSetEmpHours!cboDept) And
((Employees.Shift)=forms!frmSetEmpHours!cboShift));
Table EmployeeProduction has fields: EmployeeID, ProductionDate,
Department, Shift, JobFunctionID, HoursMachine, and HoursAssembly. The
primary key is a combination of EmployeeID, ProductionDate,
Department, and Shift.
The Employees table is linked to EmployeeProduction on EmployeeID,
Department, Shift, and JobfunctionID.
Everything I have read says to look for the No Duplicates property set
to Yes which none of them in EmployeeProduction are set to yes.
As I said earlier, until I fiddled with it it worked beautifully and
now I have no idea what I have done or how to fix it.
I am at my wit's end. Will someone please help?
Thank you so much
when I decided to fiddle with the primary key of the destination table
and now I am receiving the dreaded key violation warning.
Here is my sql:
PARAMETERS forms![frmSetEmpHours]![txtDate] DateTime;
INSERT INTO EmployeeProduction ( EmployeeID, ProductionDate,
Department, Shift, JobFunctionID )
SELECT Employees.EmployeeID, forms!frmSetEmpHours!txtDate AS
ProductionDate, Employees.Department, Employees.Shift,
Employees.JobFunctionID
FROM Employees
WHERE (((Employees.Department)=forms!frmSetEmpHours!cboDept) And
((Employees.Shift)=forms!frmSetEmpHours!cboShift));
Table EmployeeProduction has fields: EmployeeID, ProductionDate,
Department, Shift, JobFunctionID, HoursMachine, and HoursAssembly. The
primary key is a combination of EmployeeID, ProductionDate,
Department, and Shift.
The Employees table is linked to EmployeeProduction on EmployeeID,
Department, Shift, and JobfunctionID.
Everything I have read says to look for the No Duplicates property set
to Yes which none of them in EmployeeProduction are set to yes.
As I said earlier, until I fiddled with it it worked beautifully and
now I have no idea what I have done or how to fix it.
I am at my wit's end. Will someone please help?
Thank you so much