This code should work - DLookup returns a variant that is Null if the value cannot be found or the value if it finds it.
Dim varRefNo as variant
varRefNo = DLookup("[RefNo]", "Call Details Table", "[RefNo] = " & [RefNo])
where the first [RefNo] is the field in your table you are looking up...