Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 29th, 2006, 02:19 AM
Authorized User
Join Date: Nov 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Payroll in Access (Revised Posting)

Revised posting
I have started developing a simple payroll system using access. for the tax bands I have put them directly in the the code and it is calculating well. Now I need help in the following

In order to handle my calculations easily, I created two tables:
(A relationship has been created using the primary key EmployeeID)
1. tblemployeedetails; with the following fields
EmployeeID(primary Key),Name,Gender,Department,Address,
National_Registration_number,StartofContractDate(e ach contract runs for one year starting 1st April of each year)
,leavedays_per_month,Cummulative_leaveDasyTodate(c alculated for the date of start of contract),DateOfBirth,Age (calculated from the date of birth)

2.tblincomeandDeductions; with the following fields;
ID(which is just a serial counter with datatype Autonumber)
employeeid,Date(Of running the payroll,
Incomes-Dollar pay(Salaries are pegged in dollars),Basic pay(in local currency calculated),Rate(Exchange rate of the dollar for the particular month),Allowance1,
Deductions-Tax (with tax bands calculated on the local currency as follows 260,000 tax = 0, Next 720,000 tax = 30%,the rest taxed at 35%),Pension tax (calculated at 5% of the Gross pay),Personal Levy tax (calculated at 1% of the GrossPay),Advance deduction,Total Deductions,
Both incomes and deductions are in the same table. All the tax calculations are incorporated in the VBA code on form

1.Is there another way of incorporating the tax band % calculations other than puting them straight in the code
2.Help me with code combination that continues to calculate the cummulative tax year todate
2. How do I close a particular month and automatically create new records for another month and carry over the cummulative figures. Because as it is it means that I have to create new records `for each employee every month manually

when the tax bands are changed, it means that I have to go into the code and change the percentages

I need help

Bright Mulenga

Old October 5th, 2006, 10:12 AM
Authorized User
Join Date: Jan 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts

let me start from the bottom
3.to automatically enter data use an insert query
by going to database window,query,design new and open
  then find the type of query and enter (append)
 this is how the query will look like
 u are inserting records in the tbleincome and deductions

in the append from dialog box,enter append to current database,and enter table income and deductions as the table name

in the append what
enter the name of the fields e:g dollar pay for the append from,and beneath it,dollar pay as the append to field.

do likewise for all fields except date(of running payroll)
when u get to date field do the following

 under append what (type expr1:date()
 under append to (type the name of the date field )i:e date.
  under criteria enter date()-30
 what this means is that all records in your income/deductions table will be duplicated where the date is today -30days(lastmonth's record alone)

also the date in the new records will be set to today[date()]fuctions.

please remember on the show table options to show the 2 tables(tbl employee details and income/deductions table)

i have assumed while explainig that u are familaiar with the query design.

 next u will create a command button that when clicked will run the query.

Old October 5th, 2006, 10:17 AM
Authorized User
Join Date: Jan 2006
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts

for question 2
 cummulative tax to date

u will have to create a report with the following fields

then under tax u sum the tax field.
 if u use the report wizarf,it will take u by step by step,also under group by,enter emplyee name.

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Revised field on a form captainlove Access VBA 1 May 15th, 2008 07:14 AM
Payroll in Access bright_mulenga Access 1 September 27th, 2006 08:33 AM
Payroll in Access bright_mulenga Access 0 September 11th, 2006 05:00 AM
How to prepare a payroll using Access damanka2001 Access 3 May 20th, 2006 07:24 AM
Posting from a form to a access database rayncarnation ASP.NET 1.0 and 1.1 Basics 0 September 2nd, 2005 10:18 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.