Error 2448 on Form with DLookup

J

J. Trucking

Hello,

I have a form which a user inputs employee data for their time sheet.
Each Employee has a "Company Cost" as well as a "Charge Out Rate".
When the user selects an employee name from a combo box (EmployeeID is
the value that is actually stored, not the name), I use DLookup to
insert the current "Cost to Company" and "Charge Out Rate" into some
non-visible text boxes for that record. I do this because the company
costs and chargeout rates can change and I would like to save them
with the record so that if I ever want to go back to view some
historical data, I can see what the charge out rate and company cost
were for that time period.

This was working at one point but now all I get is 'RunTime Error:
2448....You can't assign a value to this object'

The form is linked to a query whcih simply orders the time sheet
entries by date when the form opens. The Dlookup Code I have is as
follows:

Me!CompanyCost = DLookup("[CompanyCost]", "tblEmployees",
"[EmployeeID]=" & Forms!frmTimeSheet!EmployeeID)
Me!ChargeOutRate = DLookup("[ChargeOutRate]", "tblEmployees",
"[EmployeeID]=" & Forms!frmTimeSheet!EmployeeID)

The Company Cost and Charge Out Rate are referenced from
'tblEmployees' and both have Currency Values. The text boxes in the
form are also set up as Currency Values. All of my values are stored
in tblTimeSheet once the time sheet record is complete.

Like I said, this worked before. When I go into debug now, the code
is getting hung up on the line "Me!CompanyCost.....". When I hold my
mouse over the line, no messages appear. I have no idea what I've
done to make this occur. Is this a reference issue?

Any help is greatly appreciated.

John
 

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

Similar Threads

Work Budget Salary vs Real Time Salary 0
DLookup in Continuous form 0
Dynamic Naming of Form Button 3
DLookUp or SELECT 2
Employee Time Tracker 2
Dlookup error 13 7
Split form 0
dlookup 2

Top