Solved

Applied sort on a datasheet view form

Posted on 2014-01-30
2
1,320 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
ID: 39822639
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
ID: 39822934
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

776 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