Hello, all,
I have a little database which deals with patients paper work. I have two tables. One is patients' basic information like name, race, age, and so on. The other is the patient's paper work including the date when the patient finishes the paper work.
So I have two forms. One if for the patients' basic information, the other form is a subform of it to show the paper work information of the patient.
My question is, when I try to see one patient's all paper work, say, 2 records, they are shown by the order of number, but not time. e.g. The first record will be paper work on 10/24/2006, while the second record will be paper work on 12/6/2005.
I hope the records can be shown by the order of time. I mean, when I check the subform, I can see 12/6/2005 first.
How can I do that
Any advice is highly appreciated!
Qian

How to show dates in forms by the order of time?
aabtahi
Hi Qian - ive just created a table and form now - i sorted the table by date and then did the same with the form by using the sort button (A-Z) within the table and the forms design properties and closed both - when i reopen they are sorted by the way that i last saved them - the form opens in datasheet view - does your form open in this way
if it still doesnt work then i would just create the query with all of the fields from the table and just change the recordsource to point to it - should take you all of 5 minutes.
Rhys.
pblecha
Yes, if I create the form from a query which has the date sorted, I could get the correct results.
But if I edit the form(which come from the table, not the query)'s properties-Order By and set it as tablename.THEDATE (just the same as the form created by the query), it can not give out the correct results.
I don't know is there other things I need to change besides the form's properties-Order By
Thank you very much!
Qian
Benjamin Coats
I can not get the form created from sorted table work, although the property shows it is Ordered By tablename.THEDATE.
So I have to select creating forms from queries. I have many functions behind the forms, it is not an easy thing for me to make sure everything is the same. :(
Any way, thanks for your patient replies. You did help me a lot!
Qian
Simon McMahon
I change the order in the table, but in the forms it is the wrong order. If I click descending order in the form, it works, but when I close my database and open it again, the right order will be gone.
Is there any way to maintain the right order for good
Qian
ruleDWorld
You could do it as sweet66 says and create a query from the table with the same fields and in the query set the date field to sort by ascending or descending, whichever you require and then set your form to use the query as the record source rather than the table.
Or on your form, go into design view , right click the form and go to properties, then in the 'order by' option enter 'tblname.fieldname' to be sorted by e.g. 'tblpaperwork.date'. that should also do it.
good luck!
Rhys.
Jim Shipley
Maybe I didn't make myself understood. My question is not about query. The subform comes from a table. I only need to see the date ordered by time in the subform. Yes, if I create a query, I can set the sort as "Descending", but I don't need the query. I only need the form.
Does it make sense
Thank you!
Qian
tisho
Hi,
In your subform query, you may set "sort" in Descending.
example:
Field: OrderDate
Table: Order
Sort: Descending
Have you've try it
Sweet
vdv_phuong
Hello,
Try to set the date in the subform in Descending order.
I hope it can help.
Sweet