function that would lookup for null value

M

magickarle

Hi, I'm trying to find a way to look in a table for null value.
If there's a null value, then I would show a msg box, if not, I would
show another msg box.

I would prefer something like dlookup, dcount ...
I've tried rs.Find "TrackingNO = Null" but not sure how to integrate
it to a if (since it doesn’t flag if it found a null or not, it merely
returns the row of the recordset.

thank you
 
D

Douglas J. Steele

Null is a special case. Null means "unknown". You can't use boolean
comparison operators with Null, since "unknown" could mean 2 in one case and
"elephant" in another...

If all you want is to know whether there are any Null values in the table,
you can using

DCount("*", "[NameOfTable]", "TrackingNO IS NULL")



--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Hi, I'm trying to find a way to look in a table for null value.
If there's a null value, then I would show a msg box, if not, I would
show another msg box.

I would prefer something like dlookup, dcount ...
I've tried rs.Find "TrackingNO = Null" but not sure how to integrate
it to a if (since it doesn’t flag if it found a null or not, it merely
returns the row of the recordset.

thank you
 
M

magickarle

Null is a special case. Null means "unknown". You can't use boolean
comparison operators with Null, since "unknown" could mean 2 in one case and
"elephant" in another...

If all you want is to know whether there are any Null values in the table,
you can using

DCount("*", "[NameOfTable]", "TrackingNO IS NULL")

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)


Hi, I'm trying to find a way to look in a table for null value.
If there's a null value, then I would show a msg box, if not, I would
show another msg box.

I would prefer something like dlookup, dcount ...
I've tried rs.Find "TrackingNO = Null" but not sure how to integrate
it to a if (since it doesn’t flag if it found a null or not, it merely
returns the row of the recordset.

thank you

Thank you. That did it!
 

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

Top