Solved

Applied sort on a datasheet view form

Posted on 2014-01-30
2
1,271 Views
Last Modified: 2014-01-31
If the user applies a sort to a column on a datasheet view form, can I make it default back to the sort order as defined in the form properties the next time it is opened?  It seems to remember the last sort and this is not what I want.
0
Comment
Question by:SteveL13
2 Comments
 
LVL 10

Accepted Solution

by:
Gozreh earned 250 total points
Comment Utility
On Load you should enter this
Me.OrderBy = ""
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 250 total points
Comment Utility
If you allow them to open the datasheet and then save it when it closes, then it will retain the OrderBy property of the form.  As Gozreh mentions, one way to remove that is to set the OrderBy property on form load.

Another way to do it is to embed the datasheet into another form and give that form button to close it.  in the code behind that button, use:

Private Sub cmd_Close_Click()

    DoCmd.Close acForm, Me.Name, acSaveNo
   
End Sub

This will prevent the changes made to the datasheet sort order, column position, and column width from saving when the main form is closed.
0

Featured Post

Highfive Gives IT Their Time Back

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…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

743 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

17 Experts available now in Live!

Get 1:1 Help Now