sort a subform containing 2 combo boxes

E

Evi

My subform (say MySubform) contains 2 combo boxes which bound by their first
(hidden)column but showing the second column.
Is there a way that I can sort first by Combo1, then by Combo2 whenever the
main form is opened?

I can't do this in the subform's query: it contains only the foreign key
fields to which the combos are bound.

Evi
 
T

Tom van Stiphout

On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"

But you can change that query to include the Column1 values. That's
indeed somewhat unusual, but seems to me appropriate in your case.

-Tom.
Microsoft Access MVP
 
E

Evi

Thats true, Tom and I've already done that but that doesn't let me sort by
column 2.
I'm doing an Esperanto<>English dictionary so that column 1 could contain
the same word several times but then column 2 will have different words to
translate that one word so I could have

gajni - earn
gajni - secure
gajni - obtain
gajni - acquire
gajni - win over
etc

and I'd like both column 1 and columm 2 to be in alphabetical order.

Evi
 
T

Tom van Stiphout

On Sun, 23 Nov 2008 20:07:13 -0000, "Evi"

Like Access itself I started counting at column0, so column1 is the
visible column.

-Tom.
 
E

Evi

I don't think I've explained myself properly, Mike.
The list within each combo is fine, it is the combos in the datasheet form
that aren't in alphabical order, that is, the first combo is, but the second
one isn't.
Evi
 
E

Evi

Yes, Tom, me too.
When I say Column 1 and 2 I'm talking about the columns in the Datasheet,
which are made up of 2 combo boxes.
I should have used the word Field. Sorry to cause confusion. Field 1 is a
combo box and field 2 is also a combo box.
I suspect that the problem is twofold. 1. that my datasheet is a subform, 2.
that I want to sort by the values in a combo box rather than by a field in
the subform.
I wanted to avoid having the second foreign key field in the subform's
query, if I could.
Otherwise I could use the OrderBy property in my code.
I see that when I Sort on one of the combos using the toolbar, the OrderBy
property contains
Lookup_cboEsp.Esperanto

My combo is actually called cboEsp and the query it is based on has 2 fields
EspID and Esperanto.

But trying to code using this, while it doesn't cause an error, doesn't seem
to do the job.

Evi
 

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