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

Query with empty fields

Status
Not open for further replies.

valterduarte

Technical User
Nov 25, 2005
15
0
0
PT
I have a table field with the following records:

Table A
aaaaa
bbbbb
(empty field)
ccccc


I want to run a parameter query that returns all the records when I leave the Parameter box empty. It's something like this:

Like IIF([Parameter A] is Null,"*",[Parameter A])

However, when I run it and leave the Parameter field empty, it returns only:

aaaaa
bbbbb
ccccc

The empty record is not included!! How do I solve this?

Thank you!
 
Assuming your field name is MyField, consider using something like:
[MyField] & "" Like Nz([Parameter A],"*")

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
If you want additional assistance you should take the time to tell us why you think it's not working.

Also, please provide us with the complete SQL view of your query.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
And what about this in the criteria cell:
Like [Parameter A] OR [Parameter A] Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Maybe the parameter field isn't null, but just empty. Try:

Len(Trim(ParameterA)) = 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top