Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OrderBy Property

Status
Not open for further replies.

mattpearcey

Technical User
Mar 7, 2001
302
GB
I have a continuous subform within a frame form to display my records. However, at present they are ordering, i guess, by default to the ID number. I want them to order by Name of the record - Alpha. How do i do this? I have tried many different things in the OrderBy property in the form's properties, but it does not work.

Thank you for your help already.

Matt Pearcey
 
My first reaction was "You need to use the OrderBy property in the SUBform not the Main form in order to change the sort order in the SubForm"

But I guess you are doing it right but missed something in the description.

However,
When a new object is created, it inherits the RecordSource, Filter, OrderBy, OrderByOn, and FilterOn properties of the table or query it was created from.

So it is possible that your form has it's OrderByOn clause set to false. If this is the case then it will ignore anything you put in the OrderBy property.

Solution:-
In the OnLoad event of the SUBform place the code

Me.OrderByOn = True




'ope-that-'elps.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.
 
Matt,

Is your subform based on a table or a query? If it's based on a table, make a query of that table and sort it to your heart's desire. Then base the subform on this.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top