Query parameters set from form, if is null how do I display allrec

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

Guest

The problem is, I have created a query that obtains its parameters from two combo boxes, ei, this first combo provides a supplier, the second displays that product range for the supplier. my question is? How do I create a query that will display all records if one of the criteria fields is empty. sort of -- IIf(isnull([forms].[Reports].[supplier],"*")) -- Now i hope i dont look to dumb, but I cant find any simple answers anywhere.
Any help would be seriously appreciated.
Kind regards
Dan
 
WHERE SupplierID = [Forms].[Reports].[supplier] OR
[Forms].[Reports].[supplier] IS NULL

BTW, I wouldn't name a form Reports: that's a reserved word, and can lead to
problems.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Daniel said:
The problem is, I have created a query that obtains its parameters from
two combo boxes, ei, this first combo provides a supplier, the second
displays that product range for the supplier. my question is? How do I
create a query that will display all records if one of the criteria fields
is empty. sort of -- IIf(isnull([forms].[Reports].[supplier],"*")) -- Now
i hope i dont look to dumb, but I cant find any simple answers anywhere.
 
Worked Perfectly, thanks Douglas

Douglas J. Steele said:
WHERE SupplierID = [Forms].[Reports].[supplier] OR
[Forms].[Reports].[supplier] IS NULL

BTW, I wouldn't name a form Reports: that's a reserved word, and can lead to
problems.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Daniel said:
The problem is, I have created a query that obtains its parameters from
two combo boxes, ei, this first combo provides a supplier, the second
displays that product range for the supplier. my question is? How do I
create a query that will display all records if one of the criteria fields
is empty. sort of -- IIf(isnull([forms].[Reports].[supplier],"*")) -- Now
i hope i dont look to dumb, but I cant find any simple answers anywhere.
Any help would be seriously appreciated.
Kind regards
Dan
 
Back
Top