Weekly Payroll

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.
 
G

Graham Mandeno

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"
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top