Re: SQL Query with Iff and Wild Card
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Tue, 13 Dec 2005 14:37:29 -0500
Probably
Like IIf(Forms![VulnerableEntitySelect]![Type] Is Not
Null,Forms![VulnerableEntitySelect]![Type],"*")
That will work as long as your field doesn't contain nulls. If the field
has nulls then the records where the field is null will not be shown.
If you need ALL records then try the following criteria
WHERE TheField = Forms![VulnerableEntitySelect]![Type] OR
Forms![VulnerableEntitySelect]![Type] Is Null
"Randy Hartwick" <RandyHartwick@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:10014242-1AC9-4284-B36D-D0C35FDA8604@xxxxxxxxxxxxxxxx
>I am trying to use the results from a form to build an SQL Query. The form
> has combo box's to select a value that is updated to a table that is in
> turn
> used as the selection criteria of the query. When I select a value the
> criteria in the query works fine. When the selection is blank (i.e. I
> should
> view all records) I don't see any records. The statement in the query is:
>
> IIf([VulnerableEntitySelect]![Type]<>"",[VulnerableEntitySelect]![Type],"*")
>
> I have tried using the asterick without the quotes and tried using null in
> place of "*" with no luck.
>
> What should I be using?
>
> Thanks,
>
> Randy
>
.
- Prev by Date: Re: Only records that do not have a certain entry in subform
- Next by Date: Re: Limit results to StrComp that produce errors
- Previous by thread: Re: Crosstab based on a query with parameters fed from a form?
- Next by thread: Re: Lock Violations in Update Query
- Index(es):
Relevant Pages
|