I'm deleting thru the form. The record source of the form is a Query though.
Here's the record source query:
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName,
TimeSheets.HoursWorked, TimeSheets.EATSTallyflag,
TimeSheets.InvoiceTallyflag, TimeSheets.WeekEnding, TimeSheets.EmployeeID,
TimeSheets.ProjectID
FROM Employees INNER JOIN TimeSheets ON Employees.EmployeeID =
TimeSheets.EmployeeID
ORDER BY Employees.FirstName, Employees.LastName, TimeSheets.WeekEnding;
That's why it's deleting both. The query contains both tables so when
you delete a record from the query, you're deleting the Employees
record (and, by implication, the related timesheets record).
Could you consider instead using a Form based on Employees, with a
Subform based on TimeSheets (showing multiple weeks if you wiah)? This
would allow you delete a timesheet record from the subform without
affecting the Employees table at all.
The alternative is to put a custom Delete button on the form to
specifically delete a record from the Timesheets table, using a Delete
query:
DoCmd.RunSQL "DELETE * FROM TimeSheets WHERE TimeSheets.EmployeeID = "
& Me!EmployeeID & " AND TimeSheets.WeekEnding = #" & Me!WeekEnding &
"#"
John W. Vinson[MVP]