Solved

What governs how records in an Access 2007 "continuous" Form are ordered?

Posted on 2009-04-02
2
329 Views
Last Modified: 2013-12-05
I am developing an Access 2007 "project" (.adp) as a front-end to a SQL Server 2005 Express database.

I have an Access Form that I am displaying in "Continuous Form" mode, in which I would like the records to be listed in a particular order.

I have tried two approaches :
When I specify my ordering preferences in the Form's "Order By" property, with its "Order By On Load" property set to "Yes", it does not do it.
If instead, I declare "Me.OrderBy = xxxxxxxx" in the Form's "Form_Load" procedure in the VBA behind the Form, it does not work.

These do not work when they are done on their own, but when I have both in place the records are listed in the Form in the sequence I want.
Can anyone tell me why I am having to do both; ie fill out the Form's properties AND a bit of VBA coding?
I would have thought that one or other of these would have been sufficient on their own.

Any advice gratefully appreciated.
Thanks. Colin.
0
Comment
Question by:colinasad
2 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 500 total points
Comment Utility
Colin,

I, too, have had bad luck with the OrderBy and OrderByOn properties of a form. I'd suggest that you just create a query that sorts the data as you like, and use that query as the recordsource for your form. Then clear the Form's OrderBy property, set OrderByOnLoad to no, and remove the Form_Load code.

HTH,

pT
0
 

Author Closing Comment

by:colinasad
Comment Utility
Apologies for not closing sooner.
I think I went on to experiment with the solution then forgot to close.
Many thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now