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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using parameter in combination with Is Null 1

Status
Not open for further replies.

doxiepup

Instructor
Sep 20, 2004
36
0
0
US
Thanks for reading this question.

I am using Access 2002. I have a table with customer addresses which includes a STATE field in which the entries are two letter abbreviations. In running a query I want to be able to supply a state abbreviation or just hit ENTER to see all the states.

I've created a query, and have the following in the criteria row of the STATE field:
Like [Which State?} or Is Null

If I type in a state abbreviation the query gives me correct results. However, if I just hit ENTER I get NO results.

I've discovered that I can change the criteria row to read
Like [Which State?} & "*"
to get the correct results.

I would like to understand why the first criterion does not work.

Thanks for your time.

Doxiepup
 
Because it resolves to
Code:
Where State Like [Which State?] or State Is Null
It's not "State" that you want to be NULL ... it's [Which State?]. So
Code:
Where State Like [Which State?] or [Which State?] Is Null
is what you need.

[small]On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. (Charles Babbage)[/small]
 
Golom:

Thank you so much! Of COURSE you are right. That makes perfect sense now.

I'm trying to learn Access using the book Learning Microsoft Access 2002 from DDC Publishing. There were two different places in the book that indicated what was to be typed in the criteria row (incorrectly) When it didn't work I couldn't figure out why.

BOY, there's alot to learn!

(I couldn't ask the instructor, because I AM the instructor)

Thanks for helping me out.

Sally
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top