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

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
 
D

Douglas J. Steele

DLookup can only return a single value.

You either need to do two separate DLookups, or else open a recordset that
returns both values.
 
J

John Spencer (MVP)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top