filter by one field and keep another in decending order

B

BikerJr

I have a list of delays and cancellations. I have a form created for a
manager to enter comments about why each D/C occurred. I have them in
decending order by date (so most recent shows up first). I need to figure
out how to keep them in decending order after looking up records by another
field, so that the most recent will show up first. For example: Manager in
Detroit goes into form and sees all D/C for 2004 in order from last to first.
Manager puts "DTW" in a lookup-type field and all D/C for DTW show up, but
they're no longer in decending order. I'm talking about people who don't use
this program (or computers in general) very much, so any step I can automate
and keep them from having to do will help with frustration.

Thanks!
 
B

BikerJr

Thanks for the suggestion. I did try that, however once I input a station to
"filter" by, the results come back out of chronological order. I think it
has something to do with the way the date was input. When I pulled up a
certain station the first record was from november 23 (11/23). The second
record was from December 9 (12/9) then the rest are in order by date. But
when I try to change the way the date is displayed it doesn't change the way
it's sorted.
 
B

BikerJr

I've checked and rechecked and it's formatted for date. In the original
table, in the query and in the form. When I sort by the date field it does
just what it's supposed to. Even after I pull out only the records for a
certain station and they come up wrong I can select the date field and sort
it and it will work just fine (now I think it's probably not a problem with
the date). I've also re-entered random dates to see if there was a problem
with how they were imported, no luck. I also tried formatting the date to a
dd/mm/yyyy format to force a zero at the front of the date hoping that would
force it to sort correctly and no luck there either.

Are ya stumped yet? Seems to confirm my suspicion that sometimes computers
do what they want to, not what you want 'em to!

Thanks again for your time and input.
 
B

BikerJr

Thanks for all your suggestions, however none of them did the trick. What
finally worked was writing an OrderBy function into the code for 3 different
places- the first for when the form is opened, the second for when records
are pulled out by one station only and the third for when the "show all"
button is clicked. I also learned that i had to write in OrderByOn = True in
order to make the database look at that rule. Looked something like this:

OrderByOn = True
Form.OrderBy = "Primary Key DESC"

I made a primary key in order to link the table with another external source
where the info is pulled from, so I told it to pull them up in descending
order.

Thought I'd post that in case it helps someone else in the future.

Thanks!
-Monique
 
Top