Changing sort order

G

Guest

Is there an addin that I can use to rearrange the sort order of a small array
of fields such as the screen for setting the Sorting and Grouping in design
view of a report or the tab order in form design view?

If there is no addin does anybody have sample code I can use.

Thanks

Steve
 
G

Guest

Thanks Allen but what I need to do is set the sort order that will last over
several months. Let's say I need to sort the names of the drivers in a car
race in the order of take off. So any report about THAT race will have THAT
sort order. In another race the same drivers will probably appear in a
different order or not at all. Different sort order. I do not want the user
to have to determine the sort order for each report but just once for each
race. Make sense??

Steve
 
A

Allen Browne

If you have a good relational structure, this issue should not arise.

Presumably many drivers drive in many races. You will therefore need at
least these 3 tables:

Race table (one record for each race). Fields:
RaceID priamary key
RaceName
RaceDate

Driver table (one record for each driver.) Fields:
DriverID primary key
Surname
Firstname

RaceDriver table (one record for each driver in each race). Fields:
RaceID which race this record is about
DriverID which driver this record is about
Result 1 for first, 2 for 2nd, ...

With that structure, you can create a report that sorts by driver, and it
will work for any race. You could create another report to sort by result,
and it also works for any race. There is no need to try to resort all the
fields for a specific race - the relational structure avoids all those
problems.

If you did want to decide at runtime whether to sort by DriverID or by
Result, the article I pointed you to can do that.
 

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