Link to home
Start Free TrialLog in
Avatar of ChadLittle
ChadLittle

asked on

How to make VBA query for an empty field

Hi,

I am trying to find fields in a query that are empty or null.  Here is an example:
SELECT tblPOHeader.ManufacturerID, tblPOHeader.POHeaderID, tblPOHeader.PVID
FROM tblPOHeader
WHERE (((tblPOHeader.PVID)=IsNull));

Open in new window

What do I put in the place of "IsNull" in line 3?
Thank you for your help.
Chad
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

You could try
SELECT tblPOHeader.ManufacturerID, tblPOHeader.POHeaderID, tblPOHeader.PVID
FROM tblPOHeader
WHERE tblPOHeader.PVID=NULL

Open in new window

Or
SELECT tblPOHeader.ManufacturerID, tblPOHeader.POHeaderID, tblPOHeader.PVID
FROM tblPOHeader
WHERE IsNull(tblPOHeader.PVID)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Cluskitt
Cluskitt
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
My first example was wrong but the 2nd one I gave or the one Cluskitt gave will work.
Avatar of ChadLittle
ChadLittle

ASKER

You answered that in 3 minutes!  Thanks for your help.  Next time I will hold my breath!
Chad