Scuba,
If I understand you, I think it will be like this...
INSERT INTO Table2 ( EmployeeID, [Date], standardhrs, timehalf,
doubletime )
SELECT Table2.[EmployeeID], DMax("[Date]","Table2")+7, 0 As SH, 0 As
HH, 0 As DH
FROM Table2
WHERE EmployeeID = Forms!NameOfYourForm!EmployeeID
Or, if the standardhrs, timehalf, and doubletime fields have their
Default Value set to 0 in the table design, you don't need to specify, so...
INSERT INTO Table2 ( EmployeeID, [Date] )
SELECT Table2.[EmployeeID], DMax("[Date]","Table2")+7
FROM Table2
WHERE EmployeeID = Forms!NameOfYourForm!EmployeeID
Alternatively...
INSERT INTO Table2 ( EmployeeID, [Date] )
SELECT Table2.[EmployeeID], Max([Date])+7
FROM Table2
GROUP BY EmployeeID
HAVING EmployeeID = Forms!NameOfYourForm!EmployeeID
--
Steve Schapel, Microsoft Access MVP
I deleted the append query off the database but I managed to find it again
on this forum board when I posted the original question:
INSERT INTO Table2 ( EmployeeID, [Date], standardhrs, timehalf, doubletime )
SELECT DISTINCT [Table2].[EmployeeID], DMax("[Date]","Table2")+7,
[Table2].[standardhrs], [Table2].[timehalf], [Table2].[doubletime]
FROM Table1 INNER JOIN Table2 ON [Table1].[EmployeeID]=[Table2].[EmployeeID];
A couple of questions:
1) If I use the button to run this query within the subform do I need the
"FROM" statement?
2) When it duplicates the previous record it obviously duplicates all the
information. How do I set the fields "standardhrs", "timehalf", "doubletime"
to zero in the new record when the query is run?
thanks