I am using a Dlookup function to find a record. There are two parameters to pass to the function, one is text (varOld) and the other is numeric (varYear).
Debug.Print varOld
Debug.Print varYear
varTeacher = DLookup("[Super]", "tblPlacements", "Super='" & varOld & "'" And "Year=" & varYear)
The two debug statements confirm that the correct data is being passed. However, the function always returns a "Type Mismatch" error on the Dlookup line.
I have split the Dlookup function into two and both work individually:
varTeacher = DLookup("[Super]", "tblPlacements", "Super='" & varOld & "'"
varTeacher = DLookup("[Super]", "tblPlacements", "Year=" & varYear)
Whenever I use Dlookup with the AND conjunction, the type mismatch error occurs.
Nigel.
Debug.Print varOld
Debug.Print varYear
varTeacher = DLookup("[Super]", "tblPlacements", "Super='" & varOld & "'" And "Year=" & varYear)
The two debug statements confirm that the correct data is being passed. However, the function always returns a "Type Mismatch" error on the Dlookup line.
I have split the Dlookup function into two and both work individually:
varTeacher = DLookup("[Super]", "tblPlacements", "Super='" & varOld & "'"
varTeacher = DLookup("[Super]", "tblPlacements", "Year=" & varYear)
Whenever I use Dlookup with the AND conjunction, the type mismatch error occurs.
Nigel.