Solved

How do I disable the sort on a Access 2010 datasheet ?

Posted on 2013-05-19
5
532 Views
Last Modified: 2013-06-08
I have a datasheet in a form.  I clicked on the ascending sort option on a field.  Now when I enter a record it immediately sorts in on that field.  I want this removed, but I cannot see where I can remove the sort.  How can I do this?
0
Comment
Question by:Braxy
5 Comments
 
LVL 7

Expert Comment

by:Beneford
ID: 39180244
The easiest way is to give it a key it can sort on.
If you have an Autonumber ID field, just transfer the sort to that.
if not, then you could create one.
Or you could create a field that automatically contains the date/time the field was entered and sort on that.

Access is SQL-based, and SQL doesn't have a concept of 'default order', and there's no guarantee that the records are actually stored in the order in which they are entered.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39181240
First see Beneford's post, the info there is essential to understanding how a table gets sorted.

<How do I disable the sort on a Access 2010 datasheet ?>
You can do this a few ways, ...here are two:

1. When you "sort" a form, you actually are setting the "Order By" property of the form.
Thus on the Open event of the form, you can clear out this property

Private Sub Form_Open(Cancel As Integer)
    Me.OrderBy = ""
End Sub


2. You can base the form on a query (not the table)
...and sort the query any way you like:

SELECT *
FROM YourTable
ORDER BY SomeField

Here you can simply make this query, then create a form with the query as the source.
Or you can enter the SQL in the form's Recordsource property directly.

JeffCoachman
0
 
LVL 75
ID: 39181936
"Access is SQL-based"
Not quite sure what you mean by that?


"and there's no guarantee that the records are actually stored in the order in which they are entered."
Actually there is. If there is no primary key, the records are 'sorted' by the order they are entered.  You can easily confirm this yourself.

mx
0
 

Accepted Solution

by:
Braxy earned 0 total points
ID: 39217748
I apologize for the delay in response.  I figured how to fix the problem.  I cleared the sort from the ribbon option
0
 

Author Closing Comment

by:Braxy
ID: 39231364
I figured out the best solution.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

760 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

20 Experts available now in Live!

Get 1:1 Help Now