Confused about text criteria

  • Thread starter Thread starter Sheila D
  • Start date Start date
S

Sheila D

Can anybody tell me why this works:

WHERE
(((Q_Procedure_Type_Strings.Combined)=[Forms]![ChooseF_Consultant_Procedure_Times]![Combined]))
OR ((([Forms]![ChooseF_Consultant_Procedure_Times]![Combined]) Is Null));

but this does not

WHERE (((Q_Procedure_Type_Strings.Combined) Like
IIf([Forms]![ChooseF_Consultant_Procedure_Times]![Combined] Is
Null,"*",[Forms]![ChooseF_Consultant_Procedure_Times]![Combined])));

I have other text criteria expressed with the Like IIF which work perfectly
so I'm puzzled! ANy help much appreciated.
Sheila
 
Sheila said:
Can anybody tell me why this works:

WHERE
(((Q_Procedure_Type_Strings.Combined)=[Forms]![ChooseF_Consultant_Procedure_Times]![Combined]))
OR ((([Forms]![ChooseF_Consultant_Procedure_Times]![Combined]) Is Null));

but this does not

WHERE (((Q_Procedure_Type_Strings.Combined) Like
IIf([Forms]![ChooseF_Consultant_Procedure_Times]![Combined] Is
Null,"*",[Forms]![ChooseF_Consultant_Procedure_Times]![Combined])));

I have other text criteria expressed with the Like IIF which work perfectly
so I'm puzzled! ANy help much appreciated.


The second only works under a bunch of restrictions
(wildcards). The first one is much more explicit without
the confusion of using Like.
 
You don't tell us why you think your second syntax doesn't work. Your issue
might be that a criteria of:
Like "*"
will not match Nulls in your field.
 
Back
Top