MS Access - Query if Address is not complet then Hold

Hi Experts,

I need a Access query Iif() that checks: Address1, City, State, Zip and if there is  any one of the fields that are blank then we send a "0" Else "-1" to a Hold Field.

Thanks for any help.
Amour22015Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nick67Commented:
Probably not an IIF.
Try this in the query grid

Hold: Nz(Address1,"")="" OR Nz(City,"")="" OR Nz(State,"")="" OR Nz(zip,"")=""
These are all Boolean comparisons that will catch whether any field is NULL or empty string and return true if any one of them is.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Amour22015Author Commented:
But don't I have to do something like:
(Nz(Address1,"")="" OR Nz(City,"")="" OR Nz(State,"")="" OR Nz(zip,"")="","1","0")

???

1=put on hold
0=Not on hold

Thanks
Nick67Commented:
we send a "0" Else "-1"
What I gave you is a Boolean evaluation
False is 0
True in Access is generally -1
Which was what you said in the question!
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Amour22015Author Commented:
Ok, seems like your:
 Nz(Address1,"")="" OR Nz(City,"")="" OR Nz(State,"")="" OR Nz(zip,"")=""
was only returning 0

so I did this:
Iif(Nz(Address1,"")="" OR Nz(City,"")="" OR Nz(State,"")="" OR Nz(zip,"")="",1,0)

And now it is working the way I need.

Thanks for your help.
Amour22015Author Commented:
Great thanks for helping.
Nick67Commented:
Glad you got it cased.
you had originally asked
I need a Access query Iif() that checks: Address1, City, State, Zip and if there is  any one of the fields that are blank then we send a "0" Else "-1" to a Hold Field.

Which would make the IIF redundant
If you wanted -- and it appears you do -- 0 and 1, then you need an IIF
It's odd that  Nz(Address1,"")="" OR Nz(City,"")="" OR Nz(State,"")="" OR Nz(zip,"")="" would return only zero and
Iif(Nz(Address1,"")="" OR Nz(City,"")="" OR Nz(State,"")="" OR Nz(zip,"")="",1,0) would return the required result as the IIF depends on the logical test.

But it works.
That's what matters.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.