IIF syntax, if null return all problem

MS Access 2003
I need help with my syntax.

IIF([district1] is null, like "*" or NZ([district]), [district1])

This is my criteria, [district1] is undefined and gives a msgbox(think thats the term, pops up asking for a value).

[district] is the field for which i am trying to establish a criteria.

What i want is to return all lines unfiltered when nothing is typed into the msgbox.
what i get is this "this expression is typed incorrectly or is toocomplex to be evaluated...."

can you help please.
I'd prefer not to do this in vb but can if needed
Thank you
norris900Asked:
Who is Participating?
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
what about this:
WHERE [district] LIKE NZ([district1], '*')

Open in new window

0
 
NorushCommented:
What do you want your query to do ?

Are [district] and [district1] 2 different fields and are they in the same table?
What is their datatype?
0
 
norris900Author Commented:
[district] is a text field in my table

[district1] is a undefined criteria for the field [district]

e.g.
select table1.district from table1 where (((table1.district)=[district1]));

I want the query to return all data when no criteria is entered by the user in the msgbox that pops up
0
 
norris900Author Commented:
Thanks was being a bit slow even for me on a monday morning :)
Perfect solution
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.