I have a number of cases where if a name appears in a particular field, I want to return that name to a variable, and if does not appear then do something else. eg :
DIM stTransfer as string
DIM stCoEq as string
If DLookup("FullName", "Qry_Results", "FullName =" & Chr(34) & stTransfer & Chr(34)) > 0 Then
stCoEq = DLookup("FullName", "Qry_Results", "FullName =" & Chr(34) & stTransfer & Chr(34))
else
make pizza
It is longwinded and I am sure there is a simpler way !