What error number could I use with CVErr() to indicate no value would be returned from an Access VBA function? I'm pulling blanks. CVErr(5) could work, but I'm hoping for something less generic. 744 ("Search text not found") is close (-ish), but still no cigar.
I'm creating a special lookup function for use in an Access Report. If the function would return no value, I'd like it to return an ERROR# value instead. Chip Pearson's discussion of this is perfect, however it's geared toward Excel, and must be altered slightly for Access.
I've searched the Error List at FMS with a variety of keywords such as "zero", "not found", "too few", etc. There are thousands of errors in the list, so any help whittling it down without having to actually read the whole list would be appreciated.
Example:
Function MyLookup(param1) as Variant
'..............
'...do stuff...
'..............
If SomethingBad = True Then
MyLookup = VBA.CVErr(N) 'What here for N?
Exit Function
Endif
End Function