Query Criteria Help

  • Thread starter Thread starter mattc66 via AccessMonster.com
  • Start date Start date
M

mattc66 via AccessMonster.com

I have my query prompt the user for entry. [USER INPUT] I want to all them to
enter data, but if left blank I'd like it to show all data. How would I
change the criteria?

Thanks
Matt
 
Like [USER INPUT] & "*"

The above could cause problems if someone just wanted to see "Base" as it
would also return "Bases" and "BaseBall".
 
What if the user leaves it blank. I want it to show all including if the
field is blank.

Jerry said:
Like [USER INPUT] & "*"

The above could cause problems if someone just wanted to see "Base" as it
would also return "Bases" and "BaseBall".
I have my query prompt the user for entry. [USER INPUT] I want to all them to
enter data, but if left blank I'd like it to show all data. How would I
change the criteria?

Thanks
Matt
 
Try the following:

Like [USER INPUT] & "*" Or Is Null
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


mattc66 via AccessMonster.com said:
What if the user leaves it blank. I want it to show all including if the
field is blank.

Jerry said:
Like [USER INPUT] & "*"

The above could cause problems if someone just wanted to see "Base" as it
would also return "Bases" and "BaseBall".
I have my query prompt the user for entry. [USER INPUT] I want to all them to
enter data, but if left blank I'd like it to show all data. How would I
change the criteria?

Thanks
Matt

--
Matt Campbell
mattc (at) saunatec [dot] com

Message posted via AccessMonster.com
 
If you wanted an exact match or if the prompt was left blank all records
with a value in the field, try the criteria

Like NZ([USER INPUT],"*")

If the field can contain null values and you want all the records if the
user leaves the criteia blank, then try

Field: Whatever
Criteria: = [User Input] or [User Input] is Null

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Jerry Whittle said:
Like [USER INPUT] & "*"

The above could cause problems if someone just wanted to see "Base" as it
would also return "Bases" and "BaseBall".
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

mattc66 via AccessMonster.com said:
I have my query prompt the user for entry. [USER INPUT] I want to all
them to
enter data, but if left blank I'd like it to show all data. How would I
change the criteria?

Thanks
Matt
 
Back
Top