Sort in VB using a ComboBox Column Other than the Bound Column

Discussion in 'Access Forms Coding' started by magmike, Jul 16, 2012.

  1. magmike

    magmike Guest

    I have a code in VB on the field labels in a continuous form that sorts based on that field when clicked,

    OrderBy = "form.field"

    However, with one field, Status, I would like to sort based on the second column (Column(1), correct?), since right now, it is sorting on the bound column, a hidden column and id number, so the user does not see alphebetical sorting.

    Is there a way to accomplish, this as the following is not working,

    OrderBy - "me.form.field.column(1)"

    Thanks in advance,

    magmike
     
    magmike, Jul 16, 2012
    #1
    1. Advertisements

  2. magmike

    Ron Weiner Guest

    magmike expressed precisely :
    > I have a code in VB on the field labels in a continuous form that sorts based
    > on that field when clicked,
    >
    > OrderBy = "form.field"
    >
    > However, with one field, Status, I would like to sort based on the second
    > column (Column(1), correct?), since right now, it is sorting on the bound
    > column, a hidden column and id number, so the user does not see alphebetical
    > sorting.
    >
    > Is there a way to accomplish, this as the following is not working,
    >
    > OrderBy - "me.form.field.column(1)"
    >
    > Thanks in advance,
    >
    > magmike


    http://www.lmgtfy.com/?q=sorting+access+combo+box
     
    Ron Weiner, Jul 16, 2012
    #2
    1. Advertisements

  3. magmike

    magmike Guest

    On Sunday, July 15, 2012 8:19:05 PM UTC-5, magmike wrote:
    > I have a code in VB on the field labels in a continuous form that sorts based on that field when clicked,
    >
    > OrderBy = "form.field"
    >
    > However, with one field, Status, I would like to sort based on the second column (Column(1), correct?), since right now, it is sorting on the bound column, a hidden column and id number, so the user does not see alphebetical sorting.
    >
    > Is there a way to accomplish, this as the following is not working,
    >
    > OrderBy - "me.form.field.column(1)"
    >
    > Thanks in advance,
    >
    > magmike


    The first time was funny. Now I am starting to think that you don't think this newsgroup is supposed to be used at all. And in fact, I did not find my answer in your search. I know how to sort a combo box. Please re-read my post or ignore it and move on.

    Can anyone else help?
     
    magmike, Jul 16, 2012
    #3
  4. magmike

    Ron Weiner Guest

    magmike has brought this to us :
    > On Sunday, July 15, 2012 8:19:05 PM UTC-5, magmike wrote:
    >> I have a code in VB on the field labels in a continuous form that sorts
    >> based on that field when clicked,
    >>
    >> OrderBy = "form.field"
    >>
    >> However, with one field, Status, I would like to sort based on the second
    >> column (Column(1), correct?), since right now, it is sorting on the bound
    >> column, a hidden column and id number, so the user does not see alphebetical
    >> sorting.
    >>
    >> Is there a way to accomplish, this as the following is not working,
    >>
    >> OrderBy - "me.form.field.column(1)"
    >>
    >> Thanks in advance,
    >>
    >> magmike

    >
    > The first time was funny. Now I am starting to think that you don't think
    > this newsgroup is supposed to be used at all. And in fact, I did not find my
    > answer in your search. I know how to sort a combo box. Please re-read my post
    > or ignore it and move on.
    >
    > Can anyone else help?


    OK you obviously do not posess the ability to do any research. So here
    is what you need to know:

    1) Neither Combo boxes, nor List boxes have a Sort method.
    2) The order of items in Combo and List boxes is controled by its Row
    Source property.

    Sooo....

    Apply whatever sort you require to the query that is the combos Row
    Source property.

    Rdub
     
    Ron Weiner, Jul 16, 2012
    #4
  5. "magmike" <> wrote

    > The first time was funny. Now I am starting to think
    > that you don't think this newsgroup is supposed to
    > be used at all.


    The Microsoft-sponsored newsgroups (including this one) used to be based at
    news.microsoft.com, but over a year ago, Microsoft took down that news
    server and replaced the sponsored newsgroups with "forums". However,
    because of the way USENET newsgroups work, they remain as "zombies" (no less
    useful than when hosted at Microsoft). But, it *is* funny that you say what
    you did because, in fact, in Microsoft's view, it isn't "supposed to be used
    at all". Those of us who do are just taking advantage of the way USENET
    works.

    --
    Larry Linson
    Microsoft Office Access MVP
    Co-Author, Microsoft Access Small Business Solutions, Wiley 2010
     
    Access Developer, Jul 16, 2012
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Rich J

    Combobox rowsource based on value of other combobox

    Rich J, Nov 9, 2004, in forum: Access Forms Coding
    Replies:
    0
    Views:
    185
    Rich J
    Nov 9, 2004
  2. website designer via AccessMonster.com

    Bound Form needs field1 Average disp. by field1 Bound Text box

    website designer via AccessMonster.com, Dec 22, 2004, in forum: Access Forms Coding
    Replies:
    1
    Views:
    204
    Michel Walsh
    Dec 22, 2004
  3. Robert M via AccessMonster.com

    ComboBox problem in bound form using parameter

    Robert M via AccessMonster.com, Oct 27, 2005, in forum: Access Forms Coding
    Replies:
    2
    Views:
    90
    Robert M via AccessMonster.com
    Nov 4, 2005
  4. Robbie Baquiran

    Combo Box - Using Values Other Than Bound Column

    Robbie Baquiran, Dec 27, 2005, in forum: Access Forms Coding
    Replies:
    2
    Views:
    114
    Robbie Baquiran
    Dec 28, 2005
  5. scottydel

    ComboBox - Bound Column is Displayed Column?

    scottydel, Aug 31, 2007, in forum: Access Forms Coding
    Replies:
    4
    Views:
    121
    scottydel
    Sep 2, 2007
  6. Associates

    combobox value depends on other combobox

    Associates, Apr 24, 2008, in forum: Access Forms Coding
    Replies:
    1
    Views:
    185
    Daniel Pineault
    Apr 24, 2008
  7. CT3or4

    Combobox Bound Column blank (after update?)

    CT3or4, Jun 13, 2008, in forum: Access Forms Coding
    Replies:
    2
    Views:
    95
    CT3or4
    Jun 24, 2008
  8. broncojim
    Replies:
    9
    Views:
    240
Loading...