Dlookup and Null

DAW

Registered User.
Local time
Yesterday, 19:05
Joined
Mar 22, 2006
Messages
70
I am pulling values from a table in a loop and there are occasions when th ereturned value is null, which errors because, I believe, I cannot assing null to a variable. Is there a better way to code this or do I really have to check each one with 'If Isnull(...'
 
Forget it - I'm being a div!! I had typecast the variable to expect a string - sorry.
 
you can do

myvalue = nz(dlookup(etc),"Nothing Found") or just
myvalue = nz(dlookup(etc),vbnullstring)

ie instead of null, set the value to something in particular
 

Users who are viewing this thread

Back
Top Bottom