If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
using query conditions to return a specific value or all values
using Access 2002...
I am trying to construct a query, using criteria which is selected from a combo box on a form. If a value is selected in the combo box, then the query will return only the value selected, but if no value is selected in the combo box (therefore the combo box has a null value) then the query will return all values. Using an IIF statement in the query criteria field, I can get the query to return the appropriate results if a value is selected from the combo box, but I am not able to return all values if nothing is selected in the combo box |
#2
|
|||
|
|||
Use this as the criterion expression:
[Forms]![FormName]![ComboBoxName] Or [Forms]![FormName]![ComboBoxName] Is Null -- Ken Snell MS ACCESS MVP "ac512" wrote in message ... using Access 2002... I am trying to construct a query, using criteria which is selected from a combo box on a form. If a value is selected in the combo box, then the query will return only the value selected, but if no value is selected in the combo box (therefore the combo box has a null value) then the query will return all values. Using an IIF statement in the query criteria field, I can get the query to return the appropriate results if a value is selected from the combo box, but I am not able to return all values if nothing is selected in the combo box |
#3
|
|||
|
|||
Thank you very much Ken
Your help is much appreciated! AC "Ken Snell [MVP]" wrote: Use this as the criterion expression: [Forms]![FormName]![ComboBoxName] Or [Forms]![FormName]![ComboBoxName] Is Null -- Ken Snell MS ACCESS MVP "ac512" wrote in message ... using Access 2002... I am trying to construct a query, using criteria which is selected from a combo box on a form. If a value is selected in the combo box, then the query will return only the value selected, but if no value is selected in the combo box (therefore the combo box has a null value) then the query will return all values. Using an IIF statement in the query criteria field, I can get the query to return the appropriate results if a value is selected from the combo box, but I am not able to return all values if nothing is selected in the combo box |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
STUCK! Query to return data with a specific alphabetical letter | Kerry | Running & Setting Up Queries | 5 | January 10th, 2005 07:48 PM |
dynamic crosstab A2002 | Brigitte P | Running & Setting Up Queries | 13 | January 2nd, 2005 04:25 PM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |
Too Few Parameters error Mail Merge Access Parameter Query | Tony_VBACoder | Mailmerge | 3 | September 14th, 2004 12:15 PM |