sorting

G

GREGORY HICKMOTT

I have a product field tied to a combo box that I need to sort by the
amount used for that client
each use is in the sample table im thinking that i need to set up a qeury
for this first then filter
but how do you sort by number of uses the most used coming up first and so
on
 
S

Steve Schapel

Gregory,

You are correct, it would be a good idea to use a query which you can
use as the Row Source of your Combobox, and sort the records in the
query according to the AmountUsed field.

If you need more specific help, please post back with more details of
your data, maybe with examples, and explanation of your desired outcome.
 
G

GREGORY HICKMOTT

I got the query working by putting my [procedures] [sample] [case] [client]
tables in a query and count procedur id
this query into a second query and adding second procedures table, If
filter the first query by client name I get the resault I was looking
for.How do I pass the fiter to the first query. first query name is
[procedurespersamplebyclentsub] the final is [procedurespersamplebyclent] I
can use the query in a combobox but I can't send the filter to the query
whitch is set by another combo box in a parent form.
 
S

Steve Schapel

Gregory,

If I understand you correctly, you can refer to the combobox on the
parent form in the criteria of the applicable field in your query, using
syntax such as [Forms]![NameOfYourParentForm]![NameOfCombobox]
 
G

GREGORY HICKMOTT

steve schaple

Form the afterupdate of the parent combo box I can change the rowsource and
with the filter

But I need to alter the first query before I can call the second

Number 1

Child16!ProceduresName.RowSource = "SELECT
[procedurespersamplebyclientsub].[ProceduresId],
[procedurespersamplebyclientsub].[ProceduresName] FROM
[procedurespersamplebyclientsub] WHERE
[procedurespersamplebyclientsub].[clientID] = -1606758480;"

number2

Child16!ProceduresName.RowSource = "SELECT
[procedurespersamplebyclient].[ProceduresId],
[procedurespersamplebyclient].[ProceduresName] FROM
[procedurespersamplebyclient];"

do I need to use a third combo box just to send the filter to the first
query and hide so the usr does not see it



Steve Schapel said:
Gregory,

If I understand you correctly, you can refer to the combobox on the
parent form in the criteria of the applicable field in your query, using
syntax such as [Forms]![NameOfYourParentForm]![NameOfCombobox]

--
Steve Schapel, Microsoft Access MVP


GREGORY said:
I got the query working by putting my [procedures] [sample] [case] [client]
tables in a query and count procedur id
this query into a second query and adding second procedures table, If
filter the first query by client name I get the resault I was looking
for.How do I pass the fiter to the first query. first query name is
[procedurespersamplebyclentsub] the final is [procedurespersamplebyclent] I
can use the query in a combobox but I can't send the filter to the query
whitch is set by another combo box in a parent form.
 
S

Steve Schapel

Gregory,

I am very sorry, I am completely lost here. What is the meaning of your
Number 1 and Number 2? Both of these refer to the same combobox, don't
they? Why are you changing the Row Source of the same combobox twice?
What is happening between the two events? What is supposed to trigger
these two adjustments to the Row Source? Are you able to describe the
whole procedure from beginning to end, of what you are trying to achieve?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top