Sorting (1 Viewer)

ryetee

Registered User.
Local time
Today, 18:37
Joined
Jul 30, 2013
Messages
952
I have a split form that displays the records from a table.
In the data tab on the property sheet for the form I have the record source as the table I want to display TBExpenses.
In the "Order by" property I have TBExpenses.dtmdate desc
This is not working. Whatever I put in "Order By" I always get the order as ascending autonum. Am I missing something? I read somewhere you have to set OrderByOn = True. I'm not sure where this is although I have tried Forms.OrderByOn = True and Me.Forms.OrderByOn =True in the open and load events of the form.

I have the following
Record Source - TBExpenses
record Type - dynaset
fetch Details - Yes
Filter - blank
Filter on Load - No
Order By - TBExpenses.dtmdate desc
Order By o load - yes
wait for processing - no
Allow additions - no
Allow deletions - no
Allow edits -yes
Allow filters - yes
Record Locks - no locks

H E L P !!
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:37
Joined
May 7, 2009
Messages
19,227
are you using query as datasource, check if there is a sorting order and remove it.
 

ryetee

Registered User.
Local time
Today, 18:37
Joined
Jul 30, 2013
Messages
952
are you using query as datasource, check if there is a sorting order and remove it.


I wasn't but changed it to use a query and it now works.

How come it didn't work using the table itself?
 

AccessBlaster

Registered User.
Local time
Today, 10:37
Joined
May 22, 2010
Messages
5,911
I wasn't but changed it to use a query and it now works.

How come it didn't work using the table itself?

Omit the table name in your Order by, just use the field name. The table name is referenced in the record source of the property sheet.

Code:
Order By [COLOR="Red"]TBExpenses[/COLOR].dtmdate desc]

Code:
Order By dtmdate desc
 

ryetee

Registered User.
Local time
Today, 18:37
Joined
Jul 30, 2013
Messages
952
Omit the table name in your Order by, just use the field name. The table name is referenced in the record source of the property sheet.

Code:
Order By [COLOR="Red"]TBExpenses[/COLOR].dtmdate desc]

Code:
Order By dtmdate desc

Already tried that as well as with and without [ and ]
I now have a query which I presort.
Still intrigued to find out why former doesn't work.
 

JHB

Have been here a while
Local time
Today, 19:37
Joined
Jun 17, 2012
Messages
7,732
Could you post a sample.
 

Users who are viewing this thread

Top Bottom