Weekly Payroll

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have created a form do do out weekly payroll with. I have a 'Details'
table with employee data in it and a 'Payroll' table with payroll data in it
(ie: Hours, OT, etc)

They are linked via the EmpID field. In the auto open event of the form I
determine the week ending date. I then need the form to CREATE an EMPTY
record for each employee that's Status is 1. So the form can then be used as
an entry form. Not quite sure how to do this... Any ideas would be great.

Thanks,
Ernst.
 
Hello Ernst

Use an append query executed in-line in your code - something like this:

strSQL = "Insert into Payroll (EmpID, WEDate) Select EmpID, " _
& Format(Me.WEDate, "\#mm/dd/yyyy\#") _
& " from Employees where Status=1;"
CurrentDb.Execute strSQL, dbFailOnError

You could associate this code with the Click event of a command button to
"Add Weekly Records"
 
Thanks. Works great.

Ernst.


Graham Mandeno said:
Hello Ernst

Use an append query executed in-line in your code - something like this:

strSQL = "Insert into Payroll (EmpID, WEDate) Select EmpID, " _
& Format(Me.WEDate, "\#mm/dd/yyyy\#") _
& " from Employees where Status=1;"
CurrentDb.Execute strSQL, dbFailOnError

You could associate this code with the Click event of a command button to
"Add Weekly Records"

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Ernst Guckel said:
Hello,

I have created a form do do out weekly payroll with. I have a 'Details'
table with employee data in it and a 'Payroll' table with payroll data in
it
(ie: Hours, OT, etc)

They are linked via the EmpID field. In the auto open event of the form I
determine the week ending date. I then need the form to CREATE an EMPTY
record for each employee that's Status is 1. So the form can then be used
as
an entry form. Not quite sure how to do this... Any ideas would be
great.

Thanks,
Ernst.
 
Back
Top