filter by one field and keep another in decending order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
BikerJr said:
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!

Create a query based on your table including all the fields you need,
sort the query the way you want, then change the source of the form to that
new query.
 
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.
 
BikerJr said:
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.

Hold on there partner. Do you have a date field or are you using text?
Check the filed format, if it is not date, it is not going to do what you
want.
 
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.
 
BikerJr said:
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.



Refresh or requery data
If you are using a Microsoft Access project, or a Microsoft Access database
that's shared on a network, other users could be changing data while you are
viewing the same data in a datasheet or form. Microsoft Access updates the
data you see at regular intervals. However, you can immediately display the
most current data by refreshing the records.

Refreshing records only updates the data that already exists in your
datasheet or form. It doesn't reorder records, display new records, or
remove deleted records and records that no longer meet specified criteria.
To perform those actions, requery the records.

Open a table, query, or form in Datasheet view, PivotTable view, or
PivotChart view, or open a form in Form view.

Do one of the following:
To refresh the records in Datasheet or Form view, click Refresh on the
Records menu.
To refresh the records in PivotTable or PivotChart view, click Refresh on
the PivotTable or PivotChart toolbar.
To requery the records, press SHIFT+F9 s


 
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
 

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

Similar Threads


Back
Top