Solved

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

Posted on 2009-04-02
2
331 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
ID: 24055928
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
ID: 31566009
Apologies for not closing sooner.
I think I went on to experiment with the solution then forgot to close.
Many thanks.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 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