Microsoft
Software
Hardware
Network
Question : How do I give user a choice to run a query filtered by either one group or showing all groups?
I'm very familiar with using a form to pass the criteria to a query to filter results for one group of records.
What I am confused about is whether it's possible to allow the user to select all records or a group of records using a form and a single query.
The goal:
Create a Form that opens a Report based on a Query.
Query is filtered by the criteria passed through the Form.
The Form has a combo box that lists each Group to be sorted.
That much is easy....
What I want is, in addition, to have the option to run the report with all groups without creating a separate query and report just for that option.
Here is what I've tried, and I may be way of base here, which is why I'm asking for your assistance:
In the criteria area of the filtered field I added:
=IIf([Forms]![Form1]![Prod
uct Number]=Null,""Like " & ""*""",[Forms]![Form1]![Pr
oduct Number])
The SQL View looks like:
WHERE (((ProductList.ProductID)=
IIf([Forms
]![Form1]!
[Product Number]=Null,"" Like " & ""*""",[Forms]![Form1]![Pr
oduct Number])))
So far, the expression will work only when there is a value. If no value is given the query returns no records. I assumed no value = Null,... maybe not. However, for testing, if I just input Like "*" into the criteria I do get all records like I wanted.
So, for some reason, the expression is not working for me or I may be going about this completely the wrong way.
Thank you for your assistance.
Jeremy
Answer : How do I give user a choice to run a query filtered by either one group or showing all groups?
use this
=IIf([Forms]![Form1]![Prod
uct Number] Is Null,[ProductID],[Forms]![
Form1]![Pr
oduct Number])
or this
=IIf(isnull([Forms]![Form1
]![Product
Number]),[ProductID],[Form
s]![Form1]
![Product Number])
Random Solutions
Difference between Full control on Top level site in a site collection and site collection administrator
asp.net I have this msql select that is returning an error Incorrect syntax near '.'. I cannot see where its.
My web page has errors and doesn't work using IE8
How to add line feed and carriage return to bullets in a string
HP dl380 g6 - esxi server need to add a usb licensing dongle to a virtual machine
Not able to login as root after PAM configuration
How to decrease CLOSE_WAIT interval
Oracle SQL: Propagate Parent value to ALL Children during Tree Walk
explain T-SQL query to me
asp.net- when running a report based on mssql data - I need to compare the begining of the monthly date to the current date.