Annie in France said:
I thought I'd nearly solved my problem there, not quite though!!
I like the sort order of my query, although it appears totally random (!) it
is the order in which I chose to type my order lines & there is a lot of
reason in it.
I cannot sort by anything in particular because there is nothing, other than
order entry.
Order entry works fine in the query, but not in the report.
If I remove the 'group by' in the report then all is fine, but I need to
group by supplier & then order number for expediting.
Why when it has sorted by any groups I have stated, does it not take the
query order?
BTW I cannot use automatic numbering when creating the order line, because I
sometimes import my order lines from Excel.
Failing all else, is there a way to create a field that increments in my
query, since that would be in the correct order & I could then use that for
sorting purposes in my reports?
Sorry, there is no built-in information in a table that
indicates when records were entered. When you view a table
in sheet view, Access can display the records in any order
that it likes (generally the most efficient/fastest order or
sorted by the primary key. The ***only*** way to retrieve
records in a specified order is by using a query with an
ORDER BY clause. Even reports generate an intrnal query to
get the records in the order you specified in the Sorting
and Grouping window.
You ***must*** have one or more fields that can be used to
sort the records. Note that an AutoNumber primary key may
look sufficient for this, but this is **not** reliable over
time.
The simplest approach is to add a Date field to the table
and set its DefaultValue to Now(). This will automatically
time stamp each new record with its date and time of
creation. If your existing records are sorted the way you
want using their primary key, then use that to fudge
acceptable values into the new field using an UPDATE query.