ordering records by datasheet view order... (1 Viewer)

Tracy

Registered User.
Local time
Today, 20:05
Joined
Oct 19, 2001
Messages
71
Hi,

Is there any way I can output records in a report in the order they appear in the datasheet view of a form?

basically, my users want to randomly order the records in the order they chose. So they just want to insert records in various places etc.. My table orders by primary key, so can anyone think of a way I can print out a report in the order the records are put in manually.

Or can anyone think of a way to number the records quickly (as in dragging in Excel).

Thanks
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 14:05
Joined
Feb 28, 2001
Messages
27,317
The only way to order records in a report is to provide a key or field on which to sort. The report could do the sort for you if the order doesn't match the table or query's natural order (whatever that means.)

In a table, the order of addition is the order of appearance, with two exceptions:

1. If the table has a primary key defined, records are presented in the order of that key.

2. If the table had a primary key at the last time that the database was compressed, the table is stored in primary key order. If the key is later removed and nothing else is done with regard to sorting, the table will still appear in that order.

Internally, tables are ALWAYS stored in the order they were presented. If you stop to think about it, the bit about "order after compression" is consistent with this, because when you did the compression, records were visited in primary key order (which is what rule 1 says) in order to be stored.

If your users wish to impose arbitrary order, they are going to have to either (a) update a separate ordering table (one table for EACH USER, what a nightmare) or (b) export this table to Excel, then manually drag-n-drop to establish sort order before printing.
 

Users who are viewing this thread

Top Bottom