C compu Registered User. Local time Today, 22:28 Joined Jul 18, 2012 Messages 22 Jul 28, 2016 #1 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)
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)
gemma-the-husky Super Moderator Staff member Local time Today, 20:28 Joined Sep 12, 2006 Messages 16,024 Jul 28, 2016 #2 you need to wrap text in " characters. MyEmpName = DLookup("[AssignedTo]", "Tasks", " [AssignedTo] = " & chr(34) & rs!NameNew & chr(34))
you need to wrap text in " characters. MyEmpName = DLookup("[AssignedTo]", "Tasks", " [AssignedTo] = " & chr(34) & rs!NameNew & chr(34))
C compu Registered User. Local time Today, 22:28 Joined Jul 18, 2012 Messages 22 Jul 28, 2016 #3 thanks man. however, i now have the error of run-time '3464' data type mismatch in criteria expression
thanks man. however, i now have the error of run-time '3464' data type mismatch in criteria expression
pbaldy Wino Moderator Staff member Local time Today, 12:28 Joined Aug 30, 2003 Messages 36,272 Jul 28, 2016 #4 What is the data type of AssignedTo? It doesn't make any sense to lookup the field in the criteria. You already have it.
What is the data type of AssignedTo? It doesn't make any sense to lookup the field in the criteria. You already have it.
gemma-the-husky Super Moderator Staff member Local time Today, 20:28 Joined Sep 12, 2006 Messages 16,024 Jul 28, 2016 #5 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
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
KenHigg Registered User Local time Today, 15:28 Joined Jun 9, 2004 Messages 13,327 Jul 28, 2016 #6 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
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