Quantcast
Viewing all articles
Browse latest Browse all 7

Criteria in a Query

Hi Curt
 
Curt Ch wrote:
> I am trying to use a combo box in a form to select the criteria for my
> query. It works for filtering if you do choose a value in the combo box.
> However, if the combo box is left blank, I want the query to show all
> records for that field. However, It will not show any fields that are
> blank. This is not a required field, so I still want all the fields to
> show if there is no value in the combo box. Here is my equation:
>
> =IIf(IsNull([Forms]![Combined Board Report Form].[Combo4]),[Medium
> 1],[Forms]![Combined Board Report Form].[Combo4])
 
Can you switch to SQL view of your query and copy/paste the SQL statement
that has been created? It's easier to correct it in the WHERE clause of the
SQL Statement than with an expression where we don't see what it's related
to. Maybe it's easier to use for example a LIKE operator than =.
 
For example:
LIKE [Forms]![Combined Board Report Form].[Combo4] & '*'
 
But this depends on the content and the datatype of the bound field of the
combo4.
 
Thanks
Henry
 
 

[MVP Office Access]

Viewing all articles
Browse latest Browse all 7

Trending Articles