dlookup/null

T

TRM

I am trying to use dlookup to find the value of a field -
sometimes there may not yet be a value in that field.
Currently I am getting and "invalid use of null" error
when this occurs. How do I prevent this?? Is it best to
use error traping to make sure flow continues?
Suggestions for this?
 
T

Terry

=Nz(Dlookup("Field","Table","criteria),"") Returns an empty string, Nz
defaults to 0
 
A

Allen Browne

DLookup() can return a Null if necessary, so the problem is either with the
arguments you are passing in or with what you are doing with the return
value.

For example, if DLookup() returns a Null, you will generate an error if you
try to assign the result to a string variable, Long, Integer, etc, -
anything except a variant.

For more information about handling Nulls, see:
Common errors with Null
at:
http://allenbrowne.com/casu-12.html
 

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

Similar Threads


Top