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!

Query Parameters - Blank for All

Status
Not open for further replies.

kidvegas19

Technical User
Dec 31, 2003
28
0
0
US
I can't seem to find an answer to this using a search, so I will post it (hopefully not 'again').

Created a parameter query that prompts for a date (for the date field of course) and prompts for a TYPE. The TYPE field can contain one of five letters, A,B,C,D,E. What I want to do is prompt for the date, and then at the TYPE prompt have the option of using a letter (records returned = that date, that letter) or all the records regardless of letter (records returned = all records for that date).

In query design in the TYPE field criteria cell I put [TYPE] and then in the OR cell I put [TYPE] Is Null. When I run the query, the date prompts first, then the TYPE. If I choose a TYPE, all is good. If I enter through the TYPE, all records in the database are returned regardless of the date.

Any quick and easy way of fixing this?

AHIA (All Help Is Appreciated)

kv
 
Eiher
Put the date parameter prompt in the two criteria lines
Or
Have only one line, with the criteria for type being Like Nz([TYPE],'*')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for the reply PHV. Neither suggestion helped. I would blame pilot error though.

Keeping the date criteria in the date field, I put Like NZ([Type], '*')in the TYPE field criteria cell. Same behavior as above.

Keeping the date criteria in the date field, I put [Type]AND [DATE]in the TYPE criteria cell with the same results.
 
Keeping the date criteria in the date field, I put Like NZ([Type], '*')in the TYPE field criteria cell. Same behavior as above
Nothing in any OR cell ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top