Thanks Graham for your help.
Yes, I'm currently entering the information in a form.
I'm getting the results I know I have something wrong but
I not sure what. I can kinda follow what you asking the
system to do. But its not happening.
I wish I could send you my form, but I know from the past
most people don't like that idea. So try to tell you
what I did and have.
The form record source is the labor per job, on this form
the data entry person enters in the following: Date,
Employee#, Job#, Operation#, Hours worked.
When this form opens it shows the last entry so they
don't have to enter duplicate information over and over.
The employee# is a combobox which has a Row Source
(Employee table with 3 items listed: Employee#,Last Name,
Regrate). I put in your information in AfterUpdate.
Private Sub EmployNo_AfterUpdate()
Me.Wages = EmployNo.Column(2)
End Sub
This Combo Box has Event On Exit which is Call
GetTotalHours, Which show the total on number of hours in
a text box for that person.
The properties I could set was the controlSource, Bound
Column and column width. Columns was what the Column
Count? If it was then if I 3 in there I would show the
employee name, I need to show Number.
I'm not sure what else I need to tell you. I currently
have the Wages on the screen so I can see if it changes,
which so far it hasn't. After typing this all in I can
see that there is alot going on before I even asked how
to this.
Thanks for you help!!!
Jeff
-----Original Message-----
Hello Jeff
I hope you are using a form to enter this data - not typing it directly into
a table!
In this case, you would be best to use a combo box to select the employee.
Your combo box's RowSource needs three columns:
1. EmployeeNumber (to store in the Labor table record)
2. EmployeeName (to display for selection by the user)
3. PayRate (to store in the Wage field)
Set its properties as follows:
ControlSource: Employee Number (where to store the selected value)
BoundColumn: 1 (the column containing the selected value)
Columns: 3
ColumnWidths: 0;;0 (first and third columns invisible)
Finally, add an AfterUpdate event procedure to your combobox:
Private Sub ComboboxName_AfterUpdate()
Me.Wage = ComboboxName.Column(2)
End Sub
This will copy the value from the third column (PayRate) into the Wage field
when an employee is selected. Note that it is Column(2) because the Column
property starts counting from zero.
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
JeffH said:
I have an employee table that has an employee number,
name, payrate, etc..
I have labor table that has the labor that was done for
jobs. Which contains the employee number, job number,
number of hours, wage.
Since an employee payrate can change many times a years.
When i'm entering the information in the labor table I
would like the current payrate to be placed in the wage
field.
How can this be done?
Thank You...
.