Sorting of records

Hellfire

Registered User.
Local time
Today, 17:48
Joined
Jul 23, 2002
Messages
57
Hi All,

This should be a fairly simple thing to do, but I am being driven up the wall!!

I have a form diplaying records, each record has a date and time (in two different collumns) "attached" to it. When I open the form, I would like it to sort in Ascending order according to firstly date and then to time.

Ie. A record entered yesterday at 10:03 and another one entered at 12:15 should be diplayed in the order that the they were entered, followed by the records entered today (in the order they were entered)

Is there anyway of forcing this to happen?

Thanks
 
Form based on Table or Query?
 
With my limited (and simple) knowledge, you could use the "orderby" property for the form.

list the order by as:

TblName.DateField,TblName.TimeField

You will have to play with the refreshing of the form if you are using it to add records, and then want them to sort accordingly.

Depending on the form complexity, you may be better basing it on a query which is easier to sort (in my opinion).

Brad.
 
I have a switchboard, from there users can click on the buttons to enter new information, every record has got a status field as well. After entering a new record, the user returns to the switchboard. When the status of the record change, it needs to be updated, I have another form, diplaying all the records still pending a status change. I would like them to be sorted in ascending order as explained earlier.

I have tried your method:

[tblname].Date,[tblname].Time

When I close the design view, I am prompted to save the changes, I select yes, but ther is no effect at all. When I go into design view again, it has defaulted back to:

[tbkname].Date

What can cause this?
 
Sorry Hellfire,

I am a bit confused as to which form you are trying to sort.

Is is the original entry form, or the form that displays the records requiring a status change?

I am guessing that both forms are based on the same table.

You may need to give a bit more detail on table / form structure for others to be of assistance.

Unless your switchboard or other form is enforcing a different filter/sort order on your form, I can not see why the Order By is resetting itself.

You could email me your db if it is not too big.

Otherwise we can hope someone with real expertise could help you out.

Brad.
 
Thanks, completely forgot, the button used to open the form with enforced a sortAscending command on the date. Got that sorted, all working in perfect order now.

Thanks
 

Users who are viewing this thread

Back
Top Bottom