Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: sort a subform containing 2 combo boxes

Geek News

sort a subform containing 2 combo boxes
"Evi" <evwool[ at ]TakeItOutntlworld.com> 11/23/2008 5:29:58 PM
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




Re: sort a subform containing 2 combo boxes
Tom van Stiphout <tom7744.no.spam[ at ]cox.net> 11/23/2008 6:42:07 PM
On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"
<evwool[ at ]TakeItOutntlworld.com> wrote:

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


[Quoted Text]
>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
>
>
>
Re: sort a subform containing 2 combo boxes
"Evi" <evwool[ at ]TakeItOutntlworld.com> 11/23/2008 8:07:13 PM
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



"Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> wrote in message
news:au8ji4l43sk5g8eec3q8gl5r15hrk1fqmi[ at ]4ax.com...
[Quoted Text]
> On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"
> <evwool[ at ]TakeItOutntlworld.com> wrote:
>
> 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
>
>
> >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
> >
> >
> >


Re: sort a subform containing 2 combo boxes
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> 11/23/2008 9:20:28 PM
Base the combo on a query with both columns and order them as you want.
If this gives to large number for the combo a choice you can reduce the size
by using buttons to pick the starting letter or a combo that uses on change
to make the query.

Evi wrote:
[Quoted Text]
> 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
>
>
>
> "Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> wrote in message
> news:au8ji4l43sk5g8eec3q8gl5r15hrk1fqmi[ at ]4ax.com...
>> On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"
>> <evwool[ at ]TakeItOutntlworld.com> wrote:
>>
>> 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
>>
>>
>>> 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


Re: sort a subform containing 2 combo boxes
Tom van Stiphout <tom7744.no.spam[ at ]cox.net> 11/23/2008 10:18:46 PM
On Sun, 23 Nov 2008 20:07:13 -0000, "Evi"
<evwool[ at ]TakeItOutntlworld.com> wrote:

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

-Tom.


[Quoted Text]
>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
>
>
>
>"Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> wrote in message
>news:au8ji4l43sk5g8eec3q8gl5r15hrk1fqmi[ at ]4ax.com...
>> On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"
>> <evwool[ at ]TakeItOutntlworld.com> wrote:
>>
>> 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
>>
>>
>> >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
>> >
>> >
>> >
>
Re: sort a subform containing 2 combo boxes
"Evi" <evwool[ at ]TakeItOutntlworld.com> 11/23/2008 11:53:32 PM
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
"Mike Painter" <mddotpainter[ at ]sbcglobal.net> wrote in message
news:pOjWk.8946$YU2.1346[ at ]nlpi066.nbdc.sbc.com...
[Quoted Text]
> Base the combo on a query with both columns and order them as you want.
> If this gives to large number for the combo a choice you can reduce the
size
> by using buttons to pick the starting letter or a combo that uses on
change
> to make the query.
>
> Evi wrote:
> > 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
> >
> >
> >
> > "Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> wrote in message
> > news:au8ji4l43sk5g8eec3q8gl5r15hrk1fqmi[ at ]4ax.com...
> >> On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"
> >> <evwool[ at ]TakeItOutntlworld.com> wrote:
> >>
> >> 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
> >>
> >>
> >>> 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
>
>


Re: sort a subform containing 2 combo boxes
"Evi" <evwool[ at ]TakeItOutntlworld.com> 11/24/2008 12:12:56 AM
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






"Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> wrote in message
news:allji49fqe28b2ag5u52mlrto2g30kuodr[ at ]4ax.com...
[Quoted Text]
> On Sun, 23 Nov 2008 20:07:13 -0000, "Evi"
> <evwool[ at ]TakeItOutntlworld.com> wrote:
>
> Like Access itself I started counting at column0, so column1 is the
> visible column.
>
> -Tom.
>
>
> >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
> >
> >
> >
> >"Tom van Stiphout" <tom7744.no.spam[ at ]cox.net> wrote in message
> >news:au8ji4l43sk5g8eec3q8gl5r15hrk1fqmi[ at ]4ax.com...
> >> On Sun, 23 Nov 2008 17:29:58 -0000, "Evi"
> >> <evwool[ at ]TakeItOutntlworld.com> wrote:
> >>
> >> 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
> >>
> >>
> >> >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
> >> >
> >> >
> >> >
> >


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net