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  

"all" in dropdown not working for query



 
 
Thread Tools Display Modes
  #1  
Old December 13th, 2005, 07:00 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default "all" in dropdown not working for query

I have a dropdown that is populated by the following query - but it
doesn't do what I want.

SELECT DISTINCT [Division group cross table].Division
FROM [Division group cross table] UNION select '(All)' from [division
group cross table]
ORDER BY [Division group cross table].Division;

I want the "all" part of it to remove the restrictive criteria. I have
seen some postings that tell you to use another column that is
invisible to the user. How do I add this other column to this query?

  #2  
Old December 13th, 2005, 07:19 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default "all" in dropdown not working for query

On 13 Dec 2005 10:00:59 -0800, papa jonah wrote:

I have a dropdown that is populated by the following query - but it
doesn't do what I want.

SELECT DISTINCT [Division group cross table].Division
FROM [Division group cross table] UNION select '(All)' from [division
group cross table]
ORDER BY [Division group cross table].Division;

I want the "all" part of it to remove the restrictive criteria. I have
seen some postings that tell you to use another column that is
invisible to the user. How do I add this other column to this query?


You're fine so far, but you have to tell the query what to do with the
value.

Set the criteria for the Division field to:

Like IIf(forms!FormName!ComboName = "All","*",
forms!FormName!ComboName)
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old December 13th, 2005, 09:20 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default "all" in dropdown not working for query

Fred,
I have included this as my criteria for the division field of my query.
Like IIf([Forms]![query form]![cbodivision]="(All)","*",[Forms]![query
form]![cbodivision])
But I am not getting anywhere.
I use cbodivision as an input to multiple queries depending on the
button that is clicked. One button works fine when I select (All). The
other does not. When I tried to make the query for the one that does
not work match the structure of the one that does, I get an error in my
docmd line.

For the query that works
I created a new field: [Forms]![query form]![cbodivision] with "(All)"
as the criteria - with all of the other criteria blank. The other
option within this criteria has
[Forms]![query form]![cbodivision] as the criteria for the "Division"
field.

This same approach is not working in the other query - which is much
more complex.

 




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
How do I create a dropdown within a dropdown? Joyce Keller General Discussion 1 December 5th, 2005 05:02 PM
Dropdown List Error cpr General Discussion 4 June 18th, 2005 06:05 PM
Outlook Rules not Working Marty General Discussion 0 May 6th, 2005 05:58 PM
Working time and days Nortos Worksheet Functions 5 May 6th, 2005 04:17 PM
Working time and days Nortos General Discussion 1 May 6th, 2005 03:47 PM


All times are GMT +1. The time now is 03:27 PM.


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