Run-time error '3075' syntax error(missing operator)

compu

Registered User.
Local time
Today, 22:28
Joined
Jul 18, 2012
Messages
22
i have this piece of code but i keep getting the run time error.

What am i doing wrong?

MyEmpName = DLookup("[AssignedTo]", "Tasks", " [AssignedTo] = " & rs!NameNew)
 
you need to wrap text in " characters.

MyEmpName = DLookup("[AssignedTo]", "Tasks", " [AssignedTo] = " & chr(34) & rs!NameNew & chr(34))
 
thanks man.

however, i now have the error of run-time '3464'

data type mismatch in criteria expression
 
What is the data type of AssignedTo? It doesn't make any sense to lookup the field in the criteria. You already have it.
 
paul's observation aside, that would imply that [assigned to] and [namenew] are not both text.

In which case, the first expression should have been correct.

what value is rs!namenew
 
Why are you looking up a value you already have? Aren't you looking up some other field in the table?

Edit: Sorry, I see pbaldy already ask that question
 

Users who are viewing this thread

Back
Top Bottom