UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Query Criteria Vs List Box Criteria, Any Version    
 
   
RAZMaddaz
post Sep 19 2019, 04:06 PM
Post#1


UtterAccess VIP
Posts: 9,596
Joined: 23-May 05
From: Bethesda, MD USA


Hi Everyone,

Let's say that I have a query with criteria, with some of the criteria already entered. Now if I create a list box used to filter the query, shouldn't the list box have the same criteria already entered too?

I assume yes, but I would like to hear back from this AWESOME web site, with someone's opinion.

Thank you!

RAZMaddaz
Go to the top of the page
 
tina t
post Sep 19 2019, 04:41 PM
Post#2



Posts: 6,107
Joined: 11-November 10
From: SoCal, USA


QUOTE
Now if I create a list box used to filter the query, shouldn't the list box have the same criteria already entered too?

well, it depends. a listbox could have absolutely nothing to do with a query dataset, except that the listbox presents some instances of a datapoint that is included in the query too.

or maybe i misunderstand the question. could you provide an example? or maybe the query SQL statement, and listbox RowSource?

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
RAZMaddaz
post Sep 19 2019, 05:46 PM
Post#3


UtterAccess VIP
Posts: 9,596
Joined: 23-May 05
From: Bethesda, MD USA


Well, if I have a query used for sub-queries and let's say it has criteria and it returns 40 records, then shouldn't this list box have the same criteria so it starts with the same 40 records?

Otherwise the list box will show more records to chose from and if the User selects one of those records, the query wil return blank, which I understand why, but I don't want to confuse the User as why it shows in the list box but returns no data.

You follow me, or am I just going crazy? laugh.gif

Thanks!

RAZMaddaz
Go to the top of the page
 
Jeff B.
post Sep 19 2019, 06:12 PM
Post#4


UtterAccess VIP
Posts: 10,300
Joined: 30-April 10
From: Pacific NorthWet


Your query 'feeding' the listbox has criteria. Are those part of the query (e.g., WHERE [YourField] > 3) and/or are the criteria of the 'parameter' variety (e.g., the query includes a selection criterion of something like [Enter Your Criterion Here])?

And after the query 'feeds' the listbox, wouldn't the listbox contain the results of the query (e.g., the records selected)? So how are you envisioning the listbox containing the "criteria"?

… or are you saying you want to modify the selection criteria so the listbox lists DIFFERENT records?

More info, please...

--------------------
Regards

Jeff Boyce
Microsoft Access MVP (2002-2015)

Mention of hardware or software is, in no way, an endorsement thereof. The FTC of the USA made this disclaimer necessary/possible.
Go to the top of the page
 
tina t
post Sep 19 2019, 07:12 PM
Post#5



Posts: 6,107
Joined: 11-November 10
From: SoCal, USA


QUOTE
Well, if I have a query used for sub-queries and let's say it has criteria and it returns 40 records, then shouldn't this list box have the same criteria so it starts with the same 40 records?

if you want the listbox RowSource to return the same dataset as the query, then yes, i'd say it should have the same criteria as the query. you're using the listbox to navigate between, or choose, specific records in the subform based on the query, is that correct?

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
RAZMaddaz
post Sep 19 2019, 08:00 PM
Post#6


UtterAccess VIP
Posts: 9,596
Joined: 23-May 05
From: Bethesda, MD USA


Tina, what you said is 100% correct.

John, you are correct, too.

I wish I could explain everything, but you both helped me and I don't want to waste anymore of your time.

Thank you! thumbup.gif

RAZMaddaz
Go to the top of the page
 
tina t
post Sep 20 2019, 01:51 PM
Post#7



Posts: 6,107
Joined: 11-November 10
From: SoCal, USA


you're welcome, RAZ, we're both glad to help. :) tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    15th October 2019 - 06:12 AM