Jumat, 21 Oktober 2011

RE: [MS_AccessPros] DLookup throwing a datatype mismatched

 

Art-

If EmployeeID and glngThisEmpID are integers, then why did you put quotes around
the filter argument? Try this:

gstrEmployeeName = DLookup("[Employee Name]", "[qryEmployeeExtended]",
"[EmployeeID]=" & glngThisEmpID)

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Art
Sent: Friday, October 21, 2011 7:30 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] DLookup throwing a datatype mismatched

I have the following code:

gstrEmployeeName = DLookup("[Employee Name]", "[qryEmployeeExtended]",
"[EmployeeID]='" & glngThisEmpID & "'")

Of course gstrEmployeenameis a string

glngThisEmpID is an integer

But when I run it I am getting a datatype mismatch. Any ideas?

Thanks

Art Lorenzini
Sioux Falls, SD

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar