A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

using query conditions to return a specific value or all values



 
 
Thread Tools Display Modes
  #1  
Old March 30th, 2005, 01:47 AM
ac512
external usenet poster
 
Posts: n/a
Default 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  
Old March 30th, 2005, 02:01 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

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  
Old March 30th, 2005, 02:13 AM
ac512
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 03:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.