lookup 2 values (2 columns) in the same row using dlookup

  • Thread starter Thread starter rathika
  • Start date Start date
R

rathika

hi
i need to lookup for match for 2 fields in the same row
of the table. how do i use dlookup

pls. help
rathika
 
DLookup can only return a single value.

You either need to do two separate DLookups, or else open a recordset that
returns both values.
 
Or if the two values are from the same row, you can concatenate them and them
parse them

varReturn = DLookup("FieldA & ""/"" & FieldB","TableA","[SOMEFIELD = 2")
If Len(VarReturn & "") > 0 Then
strA = Left(VarReturn,Instr(1,VarReturn,"/")-1)
strB = Mid(VarReturn,Instr(1,VarReturn,"/")+1)
End If
 
Back
Top