Runtime Error 13 Type Mismatch

berg

Registered User.
Local time
Yesterday, 21:09
Joined
Nov 23, 2012
Messages
15
Hi,

I am pretty new to VBA and am trying to do a lookup. I am getting a Runtime Error 13 Type Mismatch for the following line of code:

Me.sf_LabelView!txtLabel.value = DLookup("[Label]", "[tbl_LabelsUsed]", "[Individual_Id] = '" & IndividualId & "'" And "[Use_Id] = 1" And "[Type] = 1")

Am I missing anything obvious here?

Thanks!
 
What data type is Individual_Id? If numeric, you might try this (untested)

Me.sf_LabelView!txtLabel.value = DLookup("[Label]", "[tbl_LabelsUsed]", "[Individual_Id] = " & IndividualId & " And [Use_Id] = 1 And [Type] = 1")
 
Thanks jdraw,

I have it written as you described, but am now getting an error for expected list separator or ). Any thoughts?
 
Can you post all the code for the event?
 

Users who are viewing this thread

Back
Top Bottom