Solved

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

Posted on 2009-04-02
2
330 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

930 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

8 Experts available now in Live!

Get 1:1 Help Now