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

D

Daniel

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
 
D

Douglas J. Steele

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.
 
D

Daniel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top