crosstab query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want a crosstab query to return all records unless the user specifies a
particular account number by updating a combo box on a form. The criteria I
have in the crosstab query is as follows:

IIf(IsNull([Forms]![Form Name]![Combo7]),"*",[Forms]![Form Name]![Combo7])

When I input an acct number using the combo box the query works and returns
only those related records. When I leave the combo box null (i.e. do not
update it) and want all records returned I get zero records returned, when,
in fact, I am expecting thousands of records.

Any suggestions?
 
Try putting LIKE in front of the expression.

LIKE IIF(...)

or enter the following as the criteria
Field: Whatever
Criteria: [Forms]![Form Name]![Combo7] or [Forms]![Form Name]![Combo7] Is
Null

In the SQL statement that would be

WHERE Whatever = [Forms]![Form Name]![Combo7] or [Forms]![Form
Name]![Combo7] Is Null

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top