Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup problem

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi

I use a dlookup function to look up the value.

The question is if won't find a value in the table, would varRollup (which is variant) be null or it would just be the error?

varRollup = DLookup("TOPROLLUP", "TransitValidation", "[TRANSIT] = " & varTransit)

How can I check if no values were returned for varRollup?
 
Hi!

If Access finds no value which matches the criteria then a Null value is returned.

hth
Jeff Bridgham
bridgham@purdue.edu
 
But then

Why when I check

If not varRollup = null then
do stuff
else
exit
end if

even if varRollup is null the if statement still 'do stuff'?
 
Hi again!

The proper syntax is If IsNull(varRollUp) = False Then etc.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top