I have a perfectly ordinary DLookup instance locating a record by an autonumber code. The field I want to retrieve is defined as required, empty string allowed. The record in question has exactly that - an empty string. But when I locate the record and request the field with DLookup, it returns a Null instead of the empty string that is actually there.
To forestall questions about my senility and drug use, yes, beyond question, the record DOES exist and the field DOES have an empty string, not a Null. A SQL query retrieves the information properly, but the DLookup function turns the empty string into a Null before passing it off to my calling code. I find no mention of such behavior in any documentation of the DLookup function. The DCount function, when the contents of this field are included in the search criteria properly informs me that there is ONE record with that field = '' and ZERO records with that field Is Null.
It's easy enough to deal with now that I know what is happening, but I find this odd. Has anyone run into such behavior?
To forestall questions about my senility and drug use, yes, beyond question, the record DOES exist and the field DOES have an empty string, not a Null. A SQL query retrieves the information properly, but the DLookup function turns the empty string into a Null before passing it off to my calling code. I find no mention of such behavior in any documentation of the DLookup function. The DCount function, when the contents of this field are included in the search criteria properly informs me that there is ONE record with that field = '' and ZERO records with that field Is Null.
It's easy enough to deal with now that I know what is happening, but I find this odd. Has anyone run into such behavior?