Dear All,
I would like to use dlookup with 2 criteria
I don't want to concatenate these two criteria, I would like to evaluate them together
Here is my function in VBA:
Me.profitcombo = DLookup("[profitratiorank]", "[tbl_annualdata]", "[YearData] = " & Me.yearcombo And "[Custname] = '" & Me.customer & "'")
The above function is supposed to extract a field that matches both criteria at the same time
Instead I get the following error message: Type mismatch
I checked the data types of all the fields and they are the same
Could you please advise?
Many thanks in advance!
I would like to use dlookup with 2 criteria
I don't want to concatenate these two criteria, I would like to evaluate them together
Here is my function in VBA:
Me.profitcombo = DLookup("[profitratiorank]", "[tbl_annualdata]", "[YearData] = " & Me.yearcombo And "[Custname] = '" & Me.customer & "'")
The above function is supposed to extract a field that matches both criteria at the same time
Instead I get the following error message: Type mismatch
I checked the data types of all the fields and they are the same
Could you please advise?
Many thanks in advance!