Connecting Tech Pros Worldwide Forums | Help | Site Map

Help with Data entry

Newbie
 
Join Date: May 2007
Posts: 3
#1: May 7 '07
I have two tables, tblEmployees and tblEmployeepayment. tblEmployees has the following fields the data to this table comes from our payroll system

EmployeeID
Name
Paygroup
Employeestatus
Annualsalary

tlbEmployeepayment has the following fields which will be entered by the user.

EmployeeID
PayPerioddt
Paybegdate
Payenddate
Partialpayment
Hours
Annualsalary

I have created query from these two tables. I have one to many releationship between tblEmployees and tblEmployeepayment based on EmployeeID. I need annualsalary in my tblemployeepayment tble because I want to keep track of their salary based on payperiod. For exmple if on 5/15/2007 their salary 50000 and on 5/31/07 their salary 55000 I want keep their salary history for each pay period. The question is that when the users start data entery I want to auto populate the salaryfield for them to reduce data entery errors. Can someone help please.

JConsulting's Avatar
Expert
 
Join Date: Apr 2007
Location: Houston
Posts: 601
#2: May 7 '07

re: Help with Data entry


Quote:

Originally Posted by mobaligh

I have two tables, tblEmployees and tblEmployeepayment. tblEmployees has the following fields the data to this table comes from our payroll system

EmployeeID
Name
Paygroup
Employeestatus
Annualsalary

tlbEmployeepayment has the following fields which will be entered by the user.

EmployeeID
PayPerioddt
Paybegdate
Payenddate
Partialpayment
Hours
Annualsalary

I have created query from these two tables. I have one to many releationship between tblEmployees and tblEmployeepayment based on EmployeeID. I need annualsalary in my tblemployeepayment tble because I want to keep track of their salary based on payperiod. For exmple if on 5/15/2007 their salary 50000 and on 5/31/07 their salary 55000 I want keep their salary history for each pay period. The question is that when the users start data entery I want to auto populate the salaryfield for them to reduce data entery errors. Can someone help please.


my first thought is that you need to add an Index to your tblEmployeepayment table
UniqueID
EmployeeID
PayPerioddt
Paybegdate
Payenddate
Partialpayment
Hours
Annualsalary

How are you set up for data entry? A primary form with a subform?
J
Newbie
 
Join Date: May 2007
Posts: 3
#3: May 8 '07

re: Help with Data entry


Quote:

Originally Posted by JConsulting

my first thought is that you need to add an Index to your tblEmployeepayment table
UniqueID
EmployeeID
PayPerioddt
Paybegdate
Payenddate
Partialpayment
Hours
Annualsalary

How are you set up for data entry? A primary form with a subform?
J


Yes. I have a primary form witha subform. I do have a uniqueId in tbleployeepayment table forgot to mention it.
JConsulting's Avatar
Expert
 
Join Date: Apr 2007
Location: Houston
Posts: 601
#4: May 8 '07

re: Help with Data entry


Quote:

Originally Posted by mobaligh

Yes. I have a primary form witha subform. I do have a uniqueId in tbleployeepayment table forgot to mention it.

>>The question is that when the users start data entery I want to auto populate the salaryfield for them to reduce data entery errors. Can someone help please.

When you're beginning your data entry...

They open a record to a specific Employee?
Are they entering Hours?

How about on the form's On_Current event you do a look up based on the employee id and assign it as the Salary

me.salary = nz(dlookup("Salary","EmployeeTable","EmployeeID = " & me.EmployeeID))

something like that.
J
Newbie
 
Join Date: May 2007
Posts: 3
#5: May 8 '07

re: Help with Data entry


Quote:

Originally Posted by JConsulting

>>The question is that when the users start data entery I want to auto populate the salaryfield for them to reduce data entery errors. Can someone help please.

When you're beginning your data entry...

They open a record to a specific Employee?
Are they entering Hours?

How about on the form's On_Current event you do a look up based on the employee id and assign it as the Salary

me.salary = nz(dlookup("Salary","EmployeeTable","EmployeeID = " & me.EmployeeID))

something like that.
J

I dont' want to do a calculated field, because I want to store the salary for each pay period. When the user opens the form they enter pay period, begin date and end date and hours. I would like to keep the history for each of the pay period
JConsulting's Avatar
Expert
 
Join Date: Apr 2007
Location: Houston
Posts: 601
#6: May 8 '07

re: Help with Data entry


Quote:

Originally Posted by mobaligh

I dont' want to do a calculated field, because I want to store the salary for each pay period. When the user opens the form they enter pay period, begin date and end date and hours. I would like to keep the history for each of the pay period

Maybe you / I misunderstood...The small lookup code wouln't be in the control source of your Salary textbox...it would be in a VBA module to automatically populate it.

Isn't that what you asked for?
Reply