Is Null or all values

B

Bassel

Hello
I am trying to use as a condition in a query.
IIf(IsNull([Forms]![Print]![RC]),Is Not Null,[Forms]![Print]![RC])

What i want to do, is to take the value of RC fronm Print form as a
condition for the query.
If RC is not entered in the form, I want all values of RC to be passed to
the query

Can you help me with this problem. If, it can't be done through the query,
is there is a code through the form.

Thank you
 
B

Bassel

It didn't work. I think it is not treating * as a wild character.
Can you help me with any other suggestion
Best Regards
 
O

Ofer

Mybe RC is not null , its empty
Where RC like iif([Forms]![Print]![RC] is null or [Forms]![Print]![RC]="",
"*",[Forms]![Print]![RC])


Bassel said:
It didn't work. I think it is not treating * as a wild character.
Can you help me with any other suggestion
Best Regards
--
Bassel


Bassel said:
Hello
I am trying to use as a condition in a query.
IIf(IsNull([Forms]![Print]![RC]),Is Not Null,[Forms]![Print]![RC])

What i want to do, is to take the value of RC fronm Print form as a
condition for the query.
If RC is not entered in the form, I want all values of RC to be passed to
the query

Can you help me with this problem. If, it can't be done through the query,
is there is a code through the form.

Thank you
 
B

Bassel

It didn't work.
RC value is null for sure.

Is there is a code that can solve this problem

Best Regards
--
Bassel


Bassel said:
It didn't work. I think it is not treating * as a wild character.
Can you help me with any other suggestion
Best Regards
--
Bassel


Bassel said:
Hello
I am trying to use as a condition in a query.
IIf(IsNull([Forms]![Print]![RC]),Is Not Null,[Forms]![Print]![RC])

What i want to do, is to take the value of RC fronm Print form as a
condition for the query.
If RC is not entered in the form, I want all values of RC to be passed to
the query

Can you help me with this problem. If, it can't be done through the query,
is there is a code through the form.

Thank you
 
J

John Spencer (MVP)

Try the following as the criteria.

LIKE IIF([Forms]![Print]![RC] Is Null, "*",[Forms]![Print]![RC])

If [Forms]![Print]![RC]) is null then this will return all fields that have a value.

You can also use the following entered into one criteria "cell". This will
return all records if [Forms]![Print]![RC] is null

[Forms]![Print]![RC] or [Forms]![Print]![RC] Is NULL
 
F

fel

Hi John,

The query works fine with the criteria you had given. However, when I use
the dialog box with which I have to key in the parameter, it doesn't show the
intended results. Perhaps I would need to elaborate more. I have another
field which is month and this requires a value to be keyed in. My code goes,

If IsNull(Month) Then
MsgBox "You must enter the month."
Exit Sub


John Spencer (MVP) said:
Try the following as the criteria.

LIKE IIF([Forms]![Print]![RC] Is Null, "*",[Forms]![Print]![RC])

If [Forms]![Print]![RC]) is null then this will return all fields that have a value.

You can also use the following entered into one criteria "cell". This will
return all records if [Forms]![Print]![RC] is null

[Forms]![Print]![RC] or [Forms]![Print]![RC] Is NULL


Hello
I am trying to use as a condition in a query.
IIf(IsNull([Forms]![Print]![RC]),Is Not Null,[Forms]![Print]![RC])

What i want to do, is to take the value of RC fronm Print form as a
condition for the query.
If RC is not entered in the form, I want all values of RC to be passed to
the query

Can you help me with this problem. If, it can't be done through the query,
is there is a code through the form.

Thank you
 
Top