table sort (1 Viewer)

SantoR

Registered User.
Local time
Today, 17:22
Joined
Apr 20, 2015
Messages
38
i have a linked table(tblxyz) having property set as ORDER BY ID DESC, ID is autonumber, so my table view gives me latest record on top.

now i have a subform , where i am calling this Table.....
[Forms]![MainForm]![Sub_DisplayFm].SourceObject = "Table.tblxyz"

this gives me datasheet view of the table inside subform but its not showing sorted data

interesting thing is it give sorted data view when my table is not linked and is in same access file.
 

spikepl

Eledittingent Beliped
Local time
Today, 12:52
Joined
Nov 3, 2010
Messages
6,144
table(tblxyz) having property set as ORDER BY ID DESC,
Is a property used only when you look at the table in datasheet view, and nowhere else.


Tables have no inherent order so you always have to say which order you want. You can specify Order BY as a property of the form which uses tha table as record source, or you can use a query - with Order By specified - as record source.
 

GinaWhipp

AWF VIP
Local time
Today, 07:52
Joined
Jun 21, 2011
Messages
5,901
Create a Query, apply your sort there and use that for Datasheet View.

The Table is really just the bucket that holds the water (data) and any sort applied at that level is only good at that level.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 22:52
Joined
Jan 20, 2009
Messages
12,849
The view of the table with the sort is not really the table but a special datasheet view.

You could use a query with an Order By.

However it isn't really ideal to directly show a table or a query because you have no control over it. Better to create a datasheet or Continuous form instead and use that as the SourceObject.
 

SantoR

Registered User.
Local time
Today, 17:22
Joined
Apr 20, 2015
Messages
38
thanks for your reply's i think i will use Query now...
 

Users who are viewing this thread

Top Bottom