dlookup confusion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know this subject is covered daily, but I cannot see where I have an error
in my dlookup function. Below is the information I am putting into the
update to field in my update query:

DLookUp("[employeeloadrate]","EmployeeTbl","[EmployeeUserName] ='" &
[employeeloaded] & "'")

It allows me to update, but deletes the contents of the field rather than
put in the expected $0.20. When I remove the [employeeloaded] and replace it
with a valid entry in that field, I get the desired result...

EmployeeTbl is the table to get the data
EmployeeUserName is in the employee table and is a key field and is text
Employeeloaded is usersname in the field in the table where the data needs
to go to (the table I am updating). It is text
EmployeeLoadRate is a double number

What gives?
 
Check the value returen from the DlookUp, change the query to a select query
when the Dlookup is a field in the query

Select DLookUp("[employeeloadrate]","EmployeeTbl","[EmployeeUserName] ='" &
[employeeloaded] & "'") As FieldName From TableName

Mybe the table ,EmployeeTbl, doesn't have a value to return for a specific
EmployeeUserName.
 
Back
Top