Returning a wildcard or value

N

Nathan Hughes

I have created a form from which to create tailored reports via several
unbound input fields. There is an underlying query to form these reports.
What I am trying to do is create criteria expressions that will take the
value entered and use that as a criteria and if no value is entered in the
form to not have criteria on that value.

I have attempted to use IIf statements unsucessfully.

Basically what I want it to do is:
If the control on the form has had data entered, use that as criteria for
the query
If the control on the form has not had data entered, then act like there is
no criteria.

Many thanks in advance for any assistance.
 
N

Nathan Hughes

You are a star, Many many thanks.

KARL DEWEY said:
Like [Forms]![YourForm]![YourInputField] & "*" or Is Null

Nathan Hughes said:
I have created a form from which to create tailored reports via several
unbound input fields. There is an underlying query to form these reports.
What I am trying to do is create criteria expressions that will take the
value entered and use that as a criteria and if no value is entered in the
form to not have criteria on that value.

I have attempted to use IIf statements unsucessfully.

Basically what I want it to do is:
If the control on the form has had data entered, use that as criteria for
the query
If the control on the form has not had data entered, then act like there is
no criteria.

Many thanks in advance for any assistance.
 
B

Bill Wilson

Karl,
I'm using your exact format and it works great when the field name is a
number but isn't working when the field name is text - do I have to enclose
it somehow in quotes and, if so, how do I do that?

KARL DEWEY said:
Like [Forms]![YourForm]![YourInputField] & "*" or Is Null

Nathan Hughes said:
I have created a form from which to create tailored reports via several
unbound input fields. There is an underlying query to form these reports.
What I am trying to do is create criteria expressions that will take the
value entered and use that as a criteria and if no value is entered in the
form to not have criteria on that value.

I have attempted to use IIf statements unsucessfully.

Basically what I want it to do is:
If the control on the form has had data entered, use that as criteria for
the query
If the control on the form has not had data entered, then act like there is
no criteria.

Many thanks in advance for any assistance.
 
Top