Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sorting in a Form (Access 2002)

    I have a text field in a form with a table datasource. I want to sort in descending order, however, I want number values to appear first in descending and then alpha values to appear second in descending. Is there a way to do that?
    For Example:
    2
    1
    Pilot 2
    Pilot 1

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Sorting in a Form (Access 2002)

    Create a query based on the table.
    Add a calculated field:

    N: IsNumeric([TextField])

    where TextField is the name of the field.
    Add the fields from the table.
    Sort on N (ascending) and on TextField (descending).
    This query will sort numbers before text, both in descending order.
    Use the query as record source of the form.

  3. #3
    New Lounger
    Join Date
    Jul 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Sorting in a Form (Access 2002)

    Excellent.

    Thanks Hans!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •